Initial commit
This commit is contained in:
88
src/uml/class_diagram_model.h
Normal file
88
src/uml/class_diagram_model.h
Normal file
@@ -0,0 +1,88 @@
|
||||
#pragma once
|
||||
|
||||
#include <clang-c/CXCompilationDatabase.h>
|
||||
#include <clang-c/Index.h>
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <variant>
|
||||
|
||||
namespace clanguml {
|
||||
namespace model {
|
||||
namespace class_diagram {
|
||||
|
||||
enum class scope_t { kPublic, kProtected, kPrivate };
|
||||
|
||||
enum class relationship_t {
|
||||
kExtension,
|
||||
kComposition,
|
||||
kAggregation,
|
||||
kContainment,
|
||||
kOwnership,
|
||||
kAssociation
|
||||
};
|
||||
|
||||
struct element {
|
||||
std::string name;
|
||||
std::vector<std::string> namespace_;
|
||||
};
|
||||
|
||||
struct class_element {
|
||||
scope_t scope;
|
||||
std::string name;
|
||||
std::string type;
|
||||
};
|
||||
|
||||
struct class_member : public class_element {
|
||||
bool is_relationship{false};
|
||||
};
|
||||
|
||||
struct method_argument {
|
||||
std::string type;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
struct class_method : public class_element {
|
||||
std::vector<method_argument> arguments;
|
||||
};
|
||||
|
||||
struct class_parent {
|
||||
enum class access_t { kPublic, kProtected, kPrivate };
|
||||
std::string name;
|
||||
bool is_virtual{false};
|
||||
access_t access;
|
||||
};
|
||||
|
||||
struct class_relationship {
|
||||
relationship_t type{relationship_t::kAssociation};
|
||||
std::string destination;
|
||||
std::string cardinality_source;
|
||||
std::string cardinality_destination;
|
||||
std::string label;
|
||||
};
|
||||
|
||||
struct class_ : public element {
|
||||
bool is_struct{false};
|
||||
bool is_template{false};
|
||||
std::vector<class_member> members;
|
||||
std::vector<class_method> methods;
|
||||
std::vector<class_parent> bases;
|
||||
std::vector<std::string> inner_classes;
|
||||
|
||||
std::vector<class_relationship> relationships;
|
||||
};
|
||||
|
||||
struct enum_ : public element {
|
||||
std::vector<std::string> constants;
|
||||
};
|
||||
|
||||
struct diagram {
|
||||
std::string name;
|
||||
std::vector<class_> classes;
|
||||
std::vector<enum_> enums;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user