00001 #ifndef DYNAMIC_INTERNAL_REPRESENTATION_H_INCLUDED_
00002 #define DYNAMIC_INTERNAL_REPRESENTATION_H_INCLUDED_
00003
00004 #include <list>
00005 #include <string>
00006 #include <iostream>
00007
00008 class DynamicHierarchicalChannel;
00009
00010 class DynamicObject {
00011
00012 public:
00013 std::string name_;
00014 int *address_;
00015
00016 virtual void class_name() = 0;
00017 };
00018
00019 class DynamicEventList: public DynamicObject {
00020
00021 public:
00022 std::string class_name_;
00023 std::list<int*> events_;
00024
00025 virtual void class_name();
00026 };
00027
00028 class DynamicPort: public DynamicObject {
00029 public:
00030 virtual void class_name();
00031
00032 void print(unsigned int indent);
00033 };
00034
00035 class DynamicPointer: public DynamicObject {
00036 public:
00037 virtual void class_name();
00038
00039 void print(unsigned int indent);
00040 };
00041
00042 class DynamicReference: public DynamicObject {
00043 public:
00044 virtual void class_name();
00045
00046 void print(unsigned int indent);
00047 };
00048
00049 class DynamicVariable: public DynamicObject {
00050 public:
00051 virtual void class_name();
00052
00053 void print(unsigned int indent);
00054 };
00055
00056 class DynamicEvent: public DynamicObject {
00057 public:
00058 virtual void class_name();
00059
00060 void print(unsigned int indent);
00061 };
00062
00063 class DynamicPrimChannel: public DynamicObject {
00064 public:
00065 std::string class_name_;
00066
00067 virtual void class_name();
00068
00069 void print(unsigned int indent);
00070 };
00071
00072 class DynamicEventOrListElement: public DynamicObject {
00073 public:
00074 std::string class_name_;
00075 int* event_;
00076
00077 virtual void class_name();
00078
00079 void print(unsigned int indent);
00080 };
00081
00082 class DynamicEventOrList: public DynamicEventList {
00083 public:
00084
00085 virtual void class_name();
00086
00087 void print(unsigned int indent);
00088 };
00089
00090 class DynamicEventAndListElement: public DynamicObject {
00091 public:
00092 std::string class_name_;
00093 int* event_;
00094
00095 virtual void class_name();
00096
00097 void print(unsigned int indent);
00098 };
00099
00100 class DynamicEventAndList: public DynamicEventList {
00101 public:
00102
00103 virtual void class_name();
00104
00105 void print(unsigned int indent);
00106 };
00107
00108 class DynamicModule: public DynamicObject {
00109
00110 public:
00111
00112 std::list<DynamicModule*> sub_modules_;
00113 std::list<DynamicPort*> ports_;
00114 std::list<DynamicPointer*> pointers_;
00115 std::list<DynamicReference*> references_;
00116 std::list<DynamicVariable*> variables_;
00117 std::list<DynamicPrimChannel*> sub_channels_;
00118 std::list<DynamicHierarchicalChannel*> sub_hierarchical_channels_;
00119 std::list<DynamicEvent*> events_;
00120 std::list<DynamicEventAndList*> event_and_lists_;
00121 std::list<DynamicEventOrList*> event_or_lists_;
00122
00123 virtual void class_name();
00124
00125 void print_tree(unsigned int indent = 0);
00126 };
00127
00128 class DynamicHierarchicalChannel: public DynamicModule {
00129
00130 public:
00131
00132 virtual void class_name();
00133
00134 void print_tree(unsigned int indent = 0);
00135 };
00136
00142 DynamicObject*
00143 get_dynamic_object_of_variable(
00144 DynamicModule *root,
00145 std::string host_module_type_name,
00146 int host_module_instance_id,
00147 std::string reference_name,
00148 int &instance_counter);
00149
00157 bool
00158 get_instance_id_of_hosting_module(
00159 DynamicModule *root,
00160 int *address_of_variable,
00161 std::string module_name,
00162 int &coutner);
00163
00170 std::pair<DynamicModule*, std::string>
00171 get_host_module_and_name_of_variable(DynamicModule *root, int *variable);
00172
00173 void
00174 get_all_components_of_type(
00175 DynamicModule *root,
00176 std::string type_name,
00177 std::list<DynamicModule*> &modules);
00178
00179
00180 DynamicModule*
00181 get_host_module_of_member(DynamicModule *root, int *address_of_variable);
00182
00188 DynamicObject* find_channel(DynamicModule *root, int *address_of_channel);
00189
00190 DynamicModule*
00191 get_module_instance(
00192 DynamicModule *root,
00193 const std::string &name,
00194 int instance_id,
00195 int &counter);
00196
00197 int get_mapped_channel_id_of_port(DynamicPort *port);
00198
00199 void get_id(DynamicModule *root, std::string name, int *address, int &counter, bool &found);
00200
00201
00202 #endif
00203
00204