Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

Libmap Class Reference

Collaboration diagram for Libmap:

Collaboration graph
[legend]
List of all members.

Public Types

typedef cmt_vector< LibmapLibmapVector

Public Member Functions

 Libmap ()
void add_trigger (const cmt_string &trigger_name)
void add_use (const cmt_string &use_name)
int operator!= (const Libmap &other) const
int operator== (const Libmap &other) const
void set_used ()

Static Public Member Functions

Libmapfind (const cmt_string &name, const cmt_string &package)
Libmapadd (const cmt_string &name, const cmt_string &package)
LibmapVectorlibmaps ()
Libmapfind_with_trigger (const cmt_string &name)
Libmapnull ()

Public Attributes

cmt_string name
cmt_string package
CmtSystem::cmt_string_vector triggers
bool used
CmtSystem::cmt_string_vector uses

Member Typedef Documentation

typedef cmt_vector<Libmap> Libmap::LibmapVector
 

Definition at line 32 of file cmt_triggers.cxx.

Referenced by add(), ApplicationAnalyzer::end(), LibraryAnalyzer::end(), find(), find_with_trigger(), and libmaps().


Constructor & Destructor Documentation

Libmap::Libmap  ) 
 

Definition at line 102 of file cmt_triggers.cxx.

00102                 : used (false)
00103 {
00104 }


Member Function Documentation

Libmap & Libmap::add const cmt_string name,
const cmt_string package
[static]
 

Definition at line 77 of file cmt_triggers.cxx.

References cmt_vector< T >::add(), find(), libmaps(), LibmapVector, name, null(), and package.

Referenced by TriggerAnalyzer::filter().

00078 {
00079   {
00080     Libmap& libmap = find (name, package);
00081 
00082     if (libmap != null ()) return (libmap);
00083   }
00084 
00085   LibmapVector& table = libmaps ();
00086 
00087   Libmap& libmap = table.add ();
00088 
00089   libmap.name = name;
00090   libmap.package = package;
00091 
00092   return (libmap);
00093 }

void Libmap::add_trigger const cmt_string trigger_name  ) 
 

Definition at line 106 of file cmt_triggers.cxx.

References cmt_vector< T >::add(), and triggers.

Referenced by TriggerAnalyzer::filter().

00107 {
00108   cmt_string& trigger = triggers.add ();
00109 
00110   trigger = trigger_name;
00111 }

void Libmap::add_use const cmt_string use_name  ) 
 

Definition at line 113 of file cmt_triggers.cxx.

References cmt_vector< T >::add(), and uses.

Referenced by TriggerAnalyzer::filter().

00114 {
00115   cmt_string& use = uses.add ();
00116 
00117   use = use_name;
00118 }

Libmap & Libmap::find const cmt_string name,
const cmt_string package
[static]
 

Definition at line 58 of file cmt_triggers.cxx.

References libmaps(), LibmapVector, name, null(), and cmt_vector< T >::size().

Referenced by add(), and set_used().

00059 {
00060   LibmapVector& table = libmaps ();
00061 
00062   for (int i = 0; i < table.size (); i++)
00063     {
00064       Libmap& libmap = table[i];
00065 
00066 #ifdef USE_PACKAGE_SCOPE
00067       if ((name == libmap.name) &&
00068           (package == libmap.package)) return (libmap);
00069 #else
00070       if (name == libmap.name) return (libmap);
00071 #endif
00072     }
00073 
00074   return (null ());
00075 }

Libmap & Libmap::find_with_trigger const cmt_string name  )  [static]
 

Definition at line 120 of file cmt_triggers.cxx.

References libmaps(), LibmapVector, null(), cmt_vector< T >::size(), and triggers.

Referenced by DependencyAnalyzer::filter().

00121 {
00122   LibmapVector& table = libmaps ();
00123 
00124   for (int i = 0; i < table.size (); i++)
00125     {
00126       Libmap& libmap = table[i];
00127 
00128       for (int j = 0; j < libmap.triggers.size (); j++)
00129         {
00130           const cmt_string& trigger = libmap.triggers[j];
00131 
00132           if (name == trigger) return (libmap);
00133         }
00134     }
00135 
00136   return (null ());
00137 }

Libmap::LibmapVector & Libmap::libmaps  )  [static]
 

Definition at line 95 of file cmt_triggers.cxx.

References LibmapVector.

Referenced by add(), ApplicationAnalyzer::end(), LibraryAnalyzer::end(), find(), and find_with_trigger().

00096 {
00097   static cmt_vector<Libmap> table;
00098 
00099   return (table);
00100 }

Libmap & Libmap::null  )  [static]
 

Definition at line 139 of file cmt_triggers.cxx.

Referenced by add(), DependencyAnalyzer::filter(), find(), find_with_trigger(), and set_used().

00140 {
00141   static Libmap null_libmap;
00142 
00143   return (null_libmap);
00144 }

int Libmap::operator!= const Libmap other  )  const
 

Definition at line 146 of file cmt_triggers.cxx.

00147 {
00148   return (this != &other);
00149 }

int Libmap::operator== const Libmap other  )  const
 

Definition at line 151 of file cmt_triggers.cxx.

00152 {
00153   return (this == &other);
00154 }

void Libmap::set_used  ) 
 

Definition at line 156 of file cmt_triggers.cxx.

References find(), cmt_string::find(), null(), cmt_vector< T >::size(), cmt_string::substr(), used, and uses.

Referenced by ApplicationAnalyzer::end(), and LibraryAnalyzer::end().

00157 {
00158   if (used) return;
00159 
00160   used = true;
00161 
00162   cmt_string package_name;
00163   cmt_string use_name;
00164 
00165   for (int i = 0; i < uses.size (); i++)
00166     {
00167       const cmt_string& use = uses[i];
00168 
00169       int pos = use.find ("::");
00170 
00171       if (pos == cmt_string::npos)
00172         {
00173           package_name = "";
00174           use_name = use;
00175         }
00176       else
00177         {
00178           use.substr (0, pos, package_name);
00179           use.substr (pos + 2, use_name);
00180 
00181           Libmap& libmap = find (use_name, package_name);
00182           if (libmap != null ())
00183             {
00184               libmap.set_used ();
00185             }
00186         }
00187     }
00188 }


Member Data Documentation

cmt_string Libmap::name
 

Definition at line 49 of file cmt_triggers.cxx.

Referenced by add(), ApplicationAnalyzer::end(), LibraryAnalyzer::end(), and find().

cmt_string Libmap::package
 

Definition at line 50 of file cmt_triggers.cxx.

Referenced by add(), and LibraryAnalyzer::end().

CmtSystem::cmt_string_vector Libmap::triggers
 

Definition at line 51 of file cmt_triggers.cxx.

Referenced by add_trigger(), and find_with_trigger().

bool Libmap::used
 

Definition at line 52 of file cmt_triggers.cxx.

Referenced by ApplicationAnalyzer::end(), LibraryAnalyzer::end(), and set_used().

CmtSystem::cmt_string_vector Libmap::uses
 

Definition at line 53 of file cmt_triggers.cxx.

Referenced by add_use(), and set_used().


The documentation for this class was generated from the following file:
Generated on Mon May 2 10:25:52 2005 for CMT by doxygen 1.3.5