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

Group Class Reference

#include

Collaboration diagram for Group:

[legend]
List of all members.

Public Types

typedef cmt_vector< Group >? GroupVector

Public Methods

? Group ()
? Group (const cmt_string &name)
const cmt_string &? name () const
void? set (const cmt_string &new_name)
void? clear ()
Group &? operator= (const Group &other)
bool? operator== (const cmt_string &name) const
bool? operator!= (const cmt_string &name) const

Static Public Methods

Group *? find (const cmt_string &name)
Group *? add (const cmt_string &name)
GroupVector &? groups ()
void? clear_all ()
void? show_all ()

Private Attributes

cmt_string? m_name
cmt_string? m_macro

Member Typedef Documentation

typedef cmt_vector Group::GroupVector
?

Definition at line 17 of file cmt_group.h.


Constructor & Destructor Documentation

Group::Group (? ? )?
?

Definition at line 95 of file cmt_group.cxx.

00097 {
00098 }

Group::Group (? const cmt_string &? ? name )?
?

Definition at line 101 of file cmt_group.cxx.

00101                                     : m_name (name)
00102 //----------------------------------------------------------
00103 {
00104 }

Member Function Documentation

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

Definition at line 38 of file cmt_group.cxx.

References cmt_vector< Group >::add(), find(), groups(), and set().

Referenced by Constituent::add_for_action(), and constituents_action_iterator::set().

00040 {
00041   static GroupVector& Groups = groups ();
00042 
00043   {
00044     Group* group;
00045 
00046     group = find (name);
00047     if (group != 0) return (group);
00048   }
00049 
00050   Group& group = Groups.add ();
00051   group.set (name);
00052 
00053   return (&group);
00054 }

void Group::clear (? ? )?
?

Definition at line 121 of file cmt_group.cxx.

References m_name.

Referenced by clear_all().

00123 {
00124   m_name = "";
00125 }

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

Definition at line 67 of file cmt_group.cxx.

References cmt_vector< Group >::clear(), clear(), groups(), and cmt_vector< Group >::size().

Referenced by Database::clear().

00069 {
00070   static GroupVector& Groups = groups ();
00071 
00072   for (int i = 0; i < Groups.size (); i++)
00073     {
00074       Group& group = Groups[i];
00075       group.clear ();
00076     }
00077 
00078   Groups.clear ();
00079 }

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

Definition at line 22 of file cmt_group.cxx.

References groups(), m_name, and cmt_vector< Group >::size().

Referenced by add().

00024 {
00025   static GroupVector& Groups = groups ();
00026 
00027   for (int i = 0; i < Groups.size (); i++)
00028     {
00029       Group& v = Groups[i];
00030 
00031       if (v.m_name == name) return (&v);
00032     }
00033 
00034   return (0);
00035 }

Group::GroupVector & Group::groups (? ? )? [static]
?

Definition at line 57 of file cmt_group.cxx.

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

Referenced by add(), ConstituentsMakefileGenerator::build(), clear_all(), find(), Cmt::set_standard_macros(), and show_all().

00059 {
00060   static Database& db = Database::instance ();
00061   static GroupVector& Groups = db.groups ();
00062 
00063   return (Groups);
00064 }

const cmt_string & Group::name (? ? )?
?

Definition at line 107 of file cmt_group.cxx.

Referenced by ConstituentsMakefileGenerator::build(), Cmt::set_standard_macros(), and Constituent::show().

00109 {
00110   return (m_name);
00111 }

bool Group::operator!= (? const cmt_string &? ? name )? const
?

Definition at line 144 of file cmt_group.cxx.

00146 {
00147   return ((m_name != name));
00148 }

Group & Group::operator= (? const Group &? ? other )?
?

Definition at line 128 of file cmt_group.cxx.

References m_name.

00130 {
00131   m_name = other.m_name;
00132 
00133   return (*this);
00134 }

bool Group::operator== (? const cmt_string &? ? name )? const
?

Definition at line 137 of file cmt_group.cxx.

00139 {
00140   return ((m_name == name));
00141 }

void Group::set (? const cmt_string &? ? new_name )?
?

Definition at line 114 of file cmt_group.cxx.

References m_name.

Referenced by add().

00116 {
00117   m_name = name;
00118 }

void Group::show_all (? ? )? [static]
?

Definition at line 82 of file cmt_group.cxx.

References groups(), m_name, and cmt_vector< Group >::size().

Referenced by Cmt::do_show_groups().

00084 {
00085   static GroupVector& Groups = groups ();
00086 
00087   for (int i = 0; i < Groups.size (); i++)
00088     {
00089       Group& group = Groups[i];
00090       cout << group.m_name << endl;
00091     }
00092 }

Member Data Documentation

cmt_string Group::m_macro [private]
?

Definition at line 41 of file cmt_group.h.

cmt_string Group::m_name [private]
?

Definition at line 40 of file cmt_group.h.

Referenced by clear(), find(), operator=(), set(), and show_all().


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