| 1 |
class EIdent { }; |
| 2 |
class Cstring { }; |
| 3 |
template < class KEY, class VALUE, class HASHER > class HashMapIterator |
| 4 |
{ |
| 5 |
public: |
| 6 |
virtual ~ HashMapIterator () { } |
| 7 |
}; |
| 8 |
|
| 9 |
class ECell; |
| 10 |
class ECell_ptr |
| 11 |
{ |
| 12 |
ECell *mp_element; |
| 13 |
public: |
| 14 |
ECell * operator -> () const |
| 15 |
{ |
| 16 |
return (mp_element); |
| 17 |
} |
| 18 |
} |
| 19 |
sicat_cmd_status; |
| 20 |
class CellListIterator; |
| 21 |
class ECellList |
| 22 |
{ |
| 23 |
public: |
| 24 |
virtual CellListIterator * createIterator () const = 0; |
| 25 |
virtual ECell_ptr Find (const EIdent & anIdent) = 0; |
| 26 |
}; |
| 27 |
class Foobar_Out |
| 28 |
{ |
| 29 |
virtual int get_channel () { } |
| 30 |
public: |
| 31 |
Foobar_Out & operator << (const char *str); |
| 32 |
Foobar_Out & operator << (const Cstring & cstring); |
| 33 |
}; |
| 34 |
|
| 35 |
class Foobar_Log:public Foobar_Out { }; |
| 36 |
extern Foobar_Log Foobar_LOG; |
| 37 |
template < class KEY > class BagIterator |
| 38 |
{ |
| 39 |
public: |
| 40 |
inline const KEY & operator * () const; |
| 41 |
inline int atEnd () const; |
| 42 |
}; |
| 43 |
|
| 44 |
class EMaskView; |
| 45 |
class ECell |
| 46 |
{ |
| 47 |
public: |
| 48 |
virtual const EMaskView & getMaskView () const = 0; |
| 49 |
}; |
| 50 |
class FoobarDatabase |
| 51 |
{ |
| 52 |
public: |
| 53 |
const Cstring & getName (const EIdent & id) const; |
| 54 |
ECellList *getCellList (); |
| 55 |
}; |
| 56 |
inline FoobarDatabase & |
| 57 |
DB () { } |
| 58 |
|
| 59 |
class EMaskView |
| 60 |
{ |
| 61 |
public: |
| 62 |
inline BagIterator < EIdent > getCallerIterator () const; |
| 63 |
}; |
| 64 |
struct DBHashFunctions |
| 65 |
{ |
| 66 |
}; |
| 67 |
class CellListIterator:public HashMapIterator < EIdent, ECell *, |
| 68 |
DBHashFunctions > |
| 69 |
{ |
| 70 |
}; |
| 71 |
class IdentSet |
| 72 |
{ |
| 73 |
public: |
| 74 |
unsigned int getSize () const { } |
| 75 |
int isEmpty () const { } |
| 76 |
}; |
| 77 |
class IdentSetIterator |
| 78 |
{ |
| 79 |
public: |
| 80 |
IdentSetIterator (const IdentSet * p_source) { } |
| 81 |
int atEnd () const { } |
| 82 |
EIdent operator* () const { } |
| 83 |
}; |
| 84 |
void |
| 85 |
validate () |
| 86 |
{ |
| 87 |
IdentSet complete_cell_ids; |
| 88 |
IdentSet incomplete_cell_ids; |
| 89 |
CellListIterator *p_cl_it = DB ().getCellList ()->createIterator (); |
| 90 |
delete p_cl_it; |
| 91 |
while (!incomplete_cell_ids.isEmpty ()) |
| 92 |
{ |
| 93 |
if (incomplete_cell_ids.getSize () < complete_cell_ids.getSize ()) |
| 94 |
{ |
| 95 |
IdentSetIterator complete_cell_it (&complete_cell_ids); |
| 96 |
while (!complete_cell_it.atEnd ()) |
| 97 |
{ |
| 98 |
BagIterator < EIdent > caller_it = |
| 99 |
DB ().getCellList ()->Find (*complete_cell_it)-> |
| 100 |
getMaskView ().getCallerIterator (); |
| 101 |
while (!caller_it.atEnd ()) |
| 102 |
{ |
| 103 |
Foobar_LOG << DB ().getName (*caller_it) << " "; |
| 104 |
} |
| 105 |
} |
| 106 |
} |
| 107 |
} |
| 108 |
} |