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

# Group Class Reference

`#include <cmt_group.h>`

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> Group::GroupVector

| Definition at line 11 of file cmt_group.h.

## Constructor & Destructor Documentation

Group::Group ( | )

| Definition at line 91 of file cmt_group.cxx.
    00093 {
    00094 }

Group::Group ( | const cmt_string & name )

| Definition at line 97 of file cmt_group.cxx.
    00097                                     : m_name (name)
    00098 //----------------------------------------------------------
    00099 {
    00100 }

## Member Function Documentation

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

| Definition at line 34 of file cmt_group.cxx. Referenced by constituents_action_iterator::set().
    00036 {
    00037   static GroupVector& Groups = groups ();
    00038
    00039   {
    00040     Group* group;
    00041
    00042     group = find (name);
    00043     if (group != 0) return (group);
    00044   }
    00045
    00046   Group& group = Groups.add ();
    00047   group.set (name);
    00048
    00049   return (&group);
    00050 }

void Group::clear ( | )

| Definition at line 117 of file cmt_group.cxx. Referenced by clear_all().
    00119 {
    00120   m_name = "";
    00121 }

void Group::clear_all ( | )`[static]`

| Definition at line 63 of file cmt_group.cxx. Referenced by Database::clear().
    00065 {
    00066   static GroupVector& Groups = groups ();
    00067
    00068   for (int i = 0; i < Groups.size (); i++)
    00069     {
    00070       Group& group = Groups[i];
    00071       group.clear ();
    00072     }
    00073
    00074   Groups.clear ();
    00075 }

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

| Definition at line 18 of file cmt_group.cxx.
    00020 {
    00021   static GroupVector& Groups = groups ();
    00022
    00023   for (int i = 0; i < Groups.size (); i++)
    00024     {
    00025       Group& v = Groups[i];
    00026
    00027       if (v.m_name == name) return (&v);
    00028     }
    00029
    00030   return (0);
    00031 }

Group::GroupVector & Group::groups ( | )`[static]`

| Definition at line 53 of file cmt_group.cxx. Referenced by Generator::build_constituents_makefile(), and Cmt::set_standard_macros().
    00055 {
    00056   static Database& db = Database::instance ();
    00057   static GroupVector& Groups = db.groups ();
    00058
    00059   return (Groups);
    00060 }

const cmt_string & Group::name ( | ) const

| Definition at line 103 of file cmt_group.cxx. Referenced by Generator::build_constituents_makefile(), Cmt::set_standard_macros(), and Constituent::show().
    00105 {
    00106   return (m_name);
    00107 }

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

| Definition at line 140 of file cmt_group.cxx.
    00142 {
    00143   return ((m_name != name));
    00144 }

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

| Definition at line 124 of file cmt_group.cxx.
    00126 {
    00127   m_name = other.m_name;
    00128
    00129   return (*this);
    00130 }

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

| Definition at line 133 of file cmt_group.cxx.
    00135 {
    00136   return ((m_name == name));
    00137 }

void Group::set ( | const cmt_string & name )

| Definition at line 110 of file cmt_group.cxx. Referenced by add().
    00112 {
    00113   m_name = name;
    00114 }

void Group::show_all ( | )`[static]`

| Definition at line 78 of file cmt_group.cxx. Referenced by Cmt::do_show_groups().
    00080 {
    00081   static GroupVector& Groups = groups ();
    00082
    00083   for (int i = 0; i < Groups.size (); i++)
    00084     {
    00085       Group& group = Groups[i];
    00086       cout << group.m_name << endl;
    00087     }
    00088 }

## Member Data Documentation

cmt_string Group::m_macro`[private]`

| Definition at line 35 of file cmt_group.h.

cmt_string Group::m_name`[private]`

| Definition at line 34 of file cmt_group.h.

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

- cmt_group.h
- cmt_group.cxx