Back to index

nordugrid-arc-nox  1.1.0~rc6
Public Member Functions | Protected Attributes
Arc::DBranch Class Reference

#include <DBranch.h>

Collaboration diagram for Arc::DBranch:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DBranch (void)
 ~DBranch (void)
DBranchoperator[] (const std::string &)
DBranchoperator[] (int)
DBranchAdd (const std::string &, int pos=-1)
int Size (void)
const std::string & Name (void)
DItemItem (void)
 operator DItem & (void)
DBranchoperator= (const DItem &)
void Assign (DItem *)

Protected Attributes

std::string name_
std::list< DBranch * > branches_
DItemitem_

Detailed Description

Definition at line 47 of file DBranch.h.


Constructor & Destructor Documentation

Definition at line 7 of file DBranch.cpp.

    : item_(new DItem) {}

Here is the caller graph for this function:

Definition at line 10 of file DBranch.cpp.

                        {
    delete item_;
  }

Member Function Documentation

DBranch & Arc::DBranch::Add ( const std::string &  ,
int  pos = -1 
)

Definition at line 33 of file DBranch.cpp.

                                                 {
    std::list<DBranch*>::iterator b = branches_.begin();
    for (; b != branches_.end(); ++b) {
      if (pos <= 0)
        break;
      --pos;
    }
    return **(branches_.insert(b, new DBranch));
  }
void Arc::DBranch::Assign ( DItem item)

Definition at line 70 of file DBranch.cpp.

                                  {
    DItem *old_item = item_;
    if (!item)
      item_ = new DItem;
    else
      item_ = item;
    if (old_item)
      delete old_item;
  }
DItem & Arc::DBranch::Item ( void  )

Definition at line 51 of file DBranch.cpp.

                           {
    return *item_;
  }
const std::string & Arc::DBranch::Name ( void  )

Definition at line 47 of file DBranch.cpp.

                                     {
    return name_;
  }
Arc::DBranch::operator DItem & ( void  )

Definition at line 55 of file DBranch.cpp.

                               {
    return *item_;
  }
DBranch & Arc::DBranch::operator= ( const DItem item)

Definition at line 59 of file DBranch.cpp.

                                               {
    DItem *old_item = item_;
    DItem *new_item = item.New();
    if (new_item) {
      item_ = new_item;
      if (old_item)
        delete old_item;
    }
    return *this;
  }

Here is the call graph for this function:

DBranch & Arc::DBranch::operator[] ( const std::string &  name)

Definition at line 14 of file DBranch.cpp.

                                                    {
    for (std::list<DBranch*>::iterator b = branches_.begin(); b != branches_.end(); ++b)
      if ((*b)->name_ == name)
        return **b;
    return **(branches_.insert(branches_.end(), new DBranch));
  }

Here is the call graph for this function:

DBranch & Arc::DBranch::operator[] ( int  pos)

Definition at line 21 of file DBranch.cpp.

                                      {
    std::list<DBranch*>::iterator b = branches_.begin();
    for (; b != branches_.end(); ++b) {
      if (pos <= 0)
        break;
      --pos;
    }
    if (b != branches_.end())
      return **b;
    return **(branches_.insert(b, new DBranch));
  }
int Arc::DBranch::Size ( void  )

Definition at line 43 of file DBranch.cpp.

                        {
    return branches_.size();
  }

Member Data Documentation

std::list<DBranch*> Arc::DBranch::branches_ [protected]

Definition at line 50 of file DBranch.h.

DItem* Arc::DBranch::item_ [protected]

Definition at line 51 of file DBranch.h.

std::string Arc::DBranch::name_ [protected]

Definition at line 49 of file DBranch.h.


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