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

Package Class Reference

#include

Collaboration diagram for Package:

[legend]
List of all members.

Public Types

typedef cmt_map< cmt_string,
Package >?
PackageMap
typedef cmt_vector< Package >? PackageVector

Public Methods

? Package ()
? ~Package ()
const cmt_string &? get_name () const
void? add_use (Use *use)
void? remove_use (Use *use)
Use::UsePtrVector &? get_uses ()
bool? is_cmt ()

Static Public Methods

Package *? find (const cmt_string &name)
Package *? add (const cmt_string &name)
PackageVector &? packages ()
PackageMap &? package_map ()
void? clear_all ()

Private Attributes

bool? m_is_cmt
cmt_string? m_name
Use::UsePtrVector? m_uses

Member Typedef Documentation

typedef cmt_map<cmt_string, Package> Package::PackageMap
?

Definition at line 209 of file cmt_use.h.

typedef cmt_vector Package::PackageVector
?

Definition at line 210 of file cmt_use.h.


Constructor & Destructor Documentation

Package::Package (? ? )?
?

Definition at line 4190 of file cmt_use.cxx.

References Cmt::get_debug().

04190                   : m_is_cmt (false)
04191 {
04192   if (Cmt::get_debug ())
04193     {
04194       cout << "Package::Package" << endl;
04195     }
04196 }

Package::~Package (? ? )?
?

Definition at line 4198 of file cmt_use.cxx.

References m_name.

04199 {
04200   m_name = "";
04201 }

Member Function Documentation

Package * Package::add (? const cmt_string &? ? name )? [static]
?

Definition at line 4131 of file cmt_use.cxx.

References cmt_map< cmt_string, Package >::add(), Cmt::get_debug(), m_is_cmt, m_name, package_map(), and packages().

Referenced by Use::create(), Use::set(), and Use::set_package_name().

04132 {
04133   static PackageVector& Packages = packages ();
04134   static PackageMap& PackageMap = package_map ();
04135 
04136   {
04137     Package* package;
04138 
04139     package = find (name);
04140     if (package != 0) return (package);
04141   }
04142 
04143   Package& package = Packages.add ();
04144   PackageMap.add (name, package);
04145 
04146   package.m_name = name;
04147 
04148   if (name == "CMT")
04149     {
04150       package.m_is_cmt = true;
04151     }
04152   else if (name == "methods")
04153     {
04154       package.m_is_cmt = true;
04155     }
04156 
04157   if (Cmt::get_debug ())
04158     {
04159       cout << "Package::add (" << name << ")" << endl;
04160     }
04161 
04162   return (&package);
04163 }

void Package::add_use (? Use *? ? use )?
?

Definition at line 4208 of file cmt_use.cxx.

References m_uses, cmt_vector< Use * >::push_back(), and cmt_vector< Use * >::size().

Referenced by Use::set(), and Use::set_package_name().

04209 {
04210   for (int i = 0; i < m_uses.size (); i++)
04211     {
04212       Use* u = m_uses[i];
04213       if (u == use) return;
04214     }
04215 
04216   m_uses.push_back (use);
04217 }

void Package::clear_all (? ? )? [static]
?

Definition at line 4181 of file cmt_use.cxx.

References cmt_vector< Package >::clear(), cmt_map< cmt_string, Package >::clear(), package_map(), and packages().

Referenced by Database::clear().

04182 {
04183   static PackageVector& Packages = packages ();
04184   static PackageMap& PackageMap = package_map ();
04185 
04186   PackageMap.clear ();
04187   Packages.clear ();
04188 }

Package * Package::find (? const cmt_string &? ? name )? [static]
?

Definition at line 4120 of file cmt_use.cxx.

References cmt_map< cmt_string, Package >::find(), and package_map().

Referenced by Use::find().

04121 {
04122   static PackageMap& PackageMap = package_map ();
04123 
04124   Package* result = 0;
04125 
04126   result = PackageMap.find (name);
04127 
04128   return (result);
04129 }

const cmt_string & Package::get_name (? ? )?
?

Definition at line 4203 of file cmt_use.cxx.

Referenced by StandardMacroBuilder::fill_for_all_constituents(), Use::get_package_name(), and show_packages().

04204 {
04205   return (m_name);
04206 }

Use::UsePtrVector & Package::get_uses (? ? )?
?

Definition at line 4244 of file cmt_use.cxx.

Referenced by Use::create(), Use::find(), Use::get_selected_version(), and show_packages().

04245 {
04246   return (m_uses);
04247 }

bool Package::is_cmt (? ? )?
?

Definition at line 4249 of file cmt_use.cxx.

Referenced by Script::all_print(), Script::all_print_clean(), DependencyGenerator::build(), ReadmeGenerator::build(), StandardMacroBuilder::fill_for_all_constituents(), StandardMacroBuilder::fill_for_use_includes(), StandardMacroBuilder::fill_for_use_libraries(), StandardMacroBuilder::fill_for_use_stamps(), Use::fill_macro_all(), Include::print_all(), and Cmt::print_clean().

04250 {
04251   return (m_is_cmt);
04252 }

Package::PackageMap & Package::package_map (? ? )? [static]
?

Definition at line 4173 of file cmt_use.cxx.

References Database::instance(), and Database::package_map().

Referenced by add(), clear_all(), and find().

04174 {
04175   static Database& db = Database::instance ();
04176   static PackageMap& PackageMap = db.package_map ();
04177 
04178   return (PackageMap);
04179 }

Package::PackageVector & Package::packages (? ? )? [static]
?

Definition at line 4165 of file cmt_use.cxx.

References Database::instance(), and Database::packages().

Referenced by add(), clear_all(), and show_packages().

04166 {
04167   static Database& db = Database::instance ();
04168   static PackageVector& Packages = db.packages ();
04169 
04170   return (Packages);
04171 }

void Package::remove_use (? Use *? ? use )?
?

Definition at line 4219 of file cmt_use.cxx.

References cmt_vector< Use * >::clear(), Cmt::get_debug(), Use::get_package_name(), m_name, m_uses, cmt_vector< Use * >::push_back(), and cmt_vector< Use * >::size().

Referenced by Use::clear().

04220 {
04221   if (Cmt::get_debug ())
04222     {
04223       cout << "Package::remove_use (" << use->get_package_name () << ")" << endl;
04224       cout << "  name=" << m_name
04225            << " uses=" << m_uses.size () << endl;
04226     }
04227 
04228   Use::UsePtrVector temp;
04229 
04230   temp = m_uses;
04231 
04232   m_uses.clear ();
04233 
04234   for (int i = 0; i < temp.size (); i++)
04235     {
04236       Use* u = temp[i];
04237       if (u != use)
04238         {
04239           m_uses.push_back (u);
04240         }
04241     }
04242 }

Member Data Documentation

bool Package::m_is_cmt [private]
?

Definition at line 233 of file cmt_use.h.

Referenced by add().

cmt_string Package::m_name [private]
?

Definition at line 235 of file cmt_use.h.

Referenced by add(), remove_use(), and ~Package().

Use::UsePtrVector Package::m_uses [private]
?

Definition at line 236 of file cmt_use.h.

Referenced by add_use(), and remove_use().


The documentation for this class was generated from the following files:
Generated on Wed Sep 1 11:00:46 2004 for CMT by 1.2.18