Main Page Class Hierarchy Compound List File List Compound Members File Members

# Libmap Class Reference

Collaboration diagram for Libmap:

[legend]
List of all members.

## Public Types
typedef cmt_vector<Libmap> | LibmapVector
## Public Methods
| 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 ()
## Public Attributes
cmt_string | name
cmt_string | package
CmtSystem::cmt_string_vector | triggers
bool | used
CmtSystem::cmt_string_vector | uses
## Static Public Methods
Libmap& | find (const cmt_string& name, const cmt_string& package)
Libmap& | add (const cmt_string& name, const cmt_string& package)
LibmapVector& | libmaps ()
Libmap& | find_with_trigger (const cmt_string& name)
Libmap& | null ()

## Member Typedef Documentation

typedef cmt_vector<Libmap> Libmap::LibmapVector

| Definition at line 25 of file cmt_triggers.cxx.

## Constructor & Destructor Documentation

Libmap::Libmap ( | )

| Definition at line 95 of file cmt_triggers.cxx.
    00095                 : used (false)
    00096 {
    00097 }

## Member Function Documentation

Libmap & Libmap::add ( | const cmt_string & name,
| const cmt_string & package )`[static]`

| Definition at line 70 of file cmt_triggers.cxx. Referenced by TriggerAnalyzer::filter().
    00071 {
    00072   {
    00073     Libmap& libmap = find (name, package);
    00074
    00075     if (libmap != null ()) return (libmap);
    00076   }
    00077
    00078   LibmapVector& table = libmaps ();
    00079
    00080   Libmap& libmap = table.add ();
    00081
    00082   libmap.name = name;
    00083   libmap.package = package;
    00084
    00085   return (libmap);
    00086 }

void Libmap::add_trigger ( | const cmt_string & trigger_name )

| Definition at line 99 of file cmt_triggers.cxx. Referenced by TriggerAnalyzer::filter().
    00100 {
    00101   cmt_string& trigger = triggers.add ();
    00102
    00103   trigger = trigger_name;
    00104 }

void Libmap::add_use ( | const cmt_string & use_name )

| Definition at line 106 of file cmt_triggers.cxx. Referenced by TriggerAnalyzer::filter().
    00107 {
    00108   cmt_string& use = uses.add ();
    00109
    00110   use = use_name;
    00111 }

Libmap & Libmap::find ( | const cmt_string & name,
| const cmt_string & package )`[static]`

| Definition at line 51 of file cmt_triggers.cxx. Referenced by add(), and set_used().
    00052 {
    00053   LibmapVector& table = libmaps ();
    00054
    00055   for (int i = 0; i < table.size (); i++)
    00056     {
    00057       Libmap& libmap = table[i];
    00058
    00059 #ifdef USE_PACKAGE_SCOPE
    00060       if ((name == libmap.name) &&
    00061           (package == libmap.package)) return (libmap);
    00062 #else
    00063       if (name == libmap.name) return (libmap);
    00064 #endif
    00065     }
    00066
    00067   return (null ());
    00068 }

Libmap & Libmap::find_with_trigger ( | const cmt_string & name )`[static]`

| Definition at line 113 of file cmt_triggers.cxx. Referenced by DependencyAnalyzer::filter().
    00114 {
    00115   LibmapVector& table = libmaps ();
    00116
    00117   for (int i = 0; i < table.size (); i++)
    00118     {
    00119       Libmap& libmap = table[i];
    00120
    00121       for (int j = 0; j < libmap.triggers.size (); j++)
    00122         {
    00123           const cmt_string& trigger = libmap.triggers[j];
    00124
    00125           if (name == trigger) return (libmap);
    00126         }
    00127     }
    00128
    00129   return (null ());
    00130 }

Libmap::LibmapVector & Libmap::libmaps ( | )`[static]`

| Definition at line 88 of file cmt_triggers.cxx. Referenced by add(), ApplicationAnalyzer::end(), LibraryAnalyzer::end(), find(), and find_with_trigger().
    00089 {
    00090   static cmt_vector<Libmap> table;
    00091
    00092   return (table);
    00093 }

Libmap & Libmap::null ( | )`[static]`

| Definition at line 132 of file cmt_triggers.cxx. Referenced by add(), DependencyAnalyzer::filter(), find(), find_with_trigger(), and set_used().
    00133 {
    00134   static Libmap null_libmap;
    00135
    00136   return (null_libmap);
    00137 }

int Libmap::operator!= ( | const Libmap & other ) const

| Definition at line 139 of file cmt_triggers.cxx.
    00140 {
    00141   return (this != &other);
    00142 }

int Libmap::operator== ( | const Libmap & other ) const

| Definition at line 144 of file cmt_triggers.cxx.
    00145 {
    00146   return (this == &other);
    00147 }

void Libmap::set_used ( | )

| Definition at line 149 of file cmt_triggers.cxx. Referenced by ApplicationAnalyzer::end(), and LibraryAnalyzer::end().
    00150 {
    00151   if (used) return;
    00152
    00153   used = true;
    00154
    00155   cmt_string package_name;
    00156   cmt_string use_name;
    00157
    00158   for (int i = 0; i < uses.size (); i++)
    00159     {
    00160       const cmt_string& use = uses[i];
    00161
    00162       int pos = use.find ("::");
    00163
    00164       if (pos == cmt_string::npos)
    00165         {
    00166           package_name = "";
    00167           use_name = use;
    00168         }
    00169       else
    00170         {
    00171           use.substr (0, pos, package_name);
    00172           use.substr (pos + 2, use_name);
    00173
    00174           Libmap& libmap = find (use_name, package_name);
    00175           if (libmap != null ())
    00176             {
    00177               libmap.set_used ();
    00178             }
    00179         }
    00180     }
    00181 }

## Member Data Documentation

cmt_string Libmap::name

| Definition at line 42 of file cmt_triggers.cxx.

cmt_string Libmap::package

| Definition at line 43 of file cmt_triggers.cxx.

CmtSystem::cmt_string_vector Libmap::triggers

| Definition at line 44 of file cmt_triggers.cxx.

bool Libmap::used

| Definition at line 45 of file cmt_triggers.cxx.

CmtSystem::cmt_string_vector Libmap::uses

| Definition at line 46 of file cmt_triggers.cxx.

The documentation for this class was generated from the following file:

- cmt_triggers.cxx