23 #define DEBUG_USEREL 0
38 const char *builtin_type_info[]=
40 "void@builtin@<nofile>@0@builtin definition@d?????@@0@d@",
41 "int@builtin@<nofile>@0@builtin definition@d?????@@0@d@",
42 "char@builtin@<nofile>@0@builtin definition@d?????@@0@d@",
43 "long@builtin@<nofile>@0@builtin definition@d?????@@0@d@",
44 "float@builtin@<nofile>@0@builtin definition@d?????@@0@d@",
45 "double@builtin@<nofile>@0@builtin definition@d?????@@0@d@",
48 for(
const char **ptr=builtin_type_info; *ptr!=NULL; ptr++)
69 if(lookup_module_ptr != NULL)
73 if(lookup_module_ptr!=module_ptr)
84 cerr <<
"CCCC_Project::add_module_extent: extraction failed" << endl;
100 if(found_module_ptr==new_module_ptr)
106 new_member_ptr->
parent=found_module_ptr;
108 if(found_member_ptr==new_member_ptr)
112 found_member_ptr->
add_extent(member_data_line);
116 cerr <<
"CCCC_Project::add_module extraction failed" << endl;
121 delete new_module_ptr;
122 delete new_member_ptr;
131 if(lookup_userel_ptr != NULL)
133 if(new_userel_ptr != lookup_userel_ptr)
135 delete new_userel_ptr;
137 lookup_userel_ptr->
add_extent(userel_data_line);
140 cerr <<
"Adding " << lookup_userel_ptr->
client <<
" uses "
141 << lookup_userel_ptr->
supplier << endl;
154 while(member_ptr!=NULL)
156 if(member_ptr->
parent!=NULL)
158 CCCC_Module::member_map_t::value_type
159 new_pair(member_ptr->
key(),member_ptr);
164 cerr <<
"Member " << member_ptr->
key() <<
" has no parent"
169 while(extent_ptr!=NULL)
180 (member_visibility!=extent_visibility)
193 while(userel_ptr!=NULL)
199 if(found_supplier_ptr!=supplier_ptr)
202 supplier_ptr=found_supplier_ptr;
208 if(found_client_ptr!=client_ptr)
211 client_ptr=found_client_ptr;
223 cerr <<
"Removing relationship between "
226 << userel_ptr->
client.c_str()
237 std::cerr <<
"Creating links for "
239 <<
" (" << client_ptr <<
") uses "
240 << supplier_ptr->
key()
241 <<
" (" << supplier_ptr <<
")" << std::endl;
244 CCCC_Module::relationship_map_t::value_type
245 new_supplier_pair(supplier_ptr->
key(), userel_ptr),
246 new_client_pair(client_ptr->
key(), userel_ptr);
248 supplier_ptr->
client_map.insert(new_client_pair);
256 while(extent_ptr!=NULL)
324 while(module_ptr!=NULL)
326 module_ptr->
ToFile(ofstr);
331 while(member_ptr!=NULL)
333 member_ptr->
ToFile(ofstr);
338 while(userel_ptr!=NULL)
340 userel_ptr->
ToFile(ofstr);
345 while(rejext_ptr!=NULL)
350 extent_line.
ToFile(ofstr);
373 int fromfile_status=new_module->
FromFile(ifstr);
380 int fromfile_status=new_member->
FromFile(ifstr);
387 int fromfile_status=new_userel->
FromFile(ifstr);
CCCC_Table< CCCC_Module > module_table
Visibility get_visibility()
void DisposeOfImportRecord(T *record_ptr, int fromfile_status)
virtual string key() const
relationship_map_t client_map
CCCC_Table< CCCC_Member > member_table
bool Insert(const string &s)
CCCC_Table< CCCC_Extent > rejected_extent_table
static const string MODULE_PREFIX
void add_rejected_extent(CCCC_Item &rejected_data_line)
int FromFile(ifstream &infile)
bool remove(T *old_item_ptr)
virtual int get_count(const char *count_tag)
int FromFile(ifstream &infile)
void add_module(CCCC_Item &module_data_line)
int ToFile(ofstream &outfile)
void add_extent(CCCC_Item &)
UseType get_usetype() const
int GetFromItem(CCCC_Item &item)
static const string REJEXT_PREFIX
static const string MEMBER_PREFIX
string name(int level) const
int ToFile(ofstream &outfile)
T * find_or_insert(T *new_item_ptr)
bool FromFile(ifstream &ifstr)
void add_member(CCCC_Item &member_data_line)
CCCC_Table< CCCC_UseRelationship > userel_table
Extent_Table extent_table
static void set_active_project(CCCC_Project *prj)
int ToFile(ofstream &outfile)
int AddToItem(CCCC_Item &item)
int ToFile(ofstream &outfile)
Visibility get_visibility() const
relationship_map_t supplier_map
int get_count(const char *count_tag)
void Resolve_Fields(string &field1, string &field2)
CCCC_Project(const string &name="")
bool PeekAtNextLinePrefix(ifstream &ifstr, string pfx)
void add_userel(CCCC_Item &use_data_line)
int FromFile(ifstream &infile)
static const string USEREL_PREFIX
int FromFile(ifstream &infile)
virtual void add_extent(CCCC_Item &)
friend class CCCC_UseRelationship
bool ToFile(ofstream &ofstr)