Back to index

salome-kernel  6.5.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends
DF_Container Class Reference

#include <DF_Container.hxx>

Inheritance diagram for DF_Container:
Inheritance graph
[legend]
Collaboration diagram for DF_Container:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Standard_EXPORT DF_Container ()
Standard_EXPORT ~DF_Container ()
Standard_EXPORT void SetInt (const std::string &theID, int theValue)
Standard_EXPORT int GetInt (const std::string &theID)
Standard_EXPORT bool HasIntID (const std::string &theID)
Standard_EXPORT void SetDouble (const std::string &theID, const double &theValue)
Standard_EXPORT double GetDouble (const std::string &theID)
Standard_EXPORT bool HasDoubleID (const std::string &theID)
Standard_EXPORT void SetString (const std::string &theID, const std::string &theValue)
Standard_EXPORT std::string GetString (const std::string &theID)
Standard_EXPORT bool HasStringID (const std::string &theID)
Standard_EXPORT void SetBool (const std::string &theID, bool theValue)
Standard_EXPORT bool GetBool (const std::string &theID)
Standard_EXPORT bool HasBoolID (const std::string &theID)
Standard_EXPORT void Clear ()
virtual Standard_EXPORT const
std::string & 
ID () const
virtual Standard_EXPORT void Restore (DF_Attribute *theAttribute)
virtual Standard_EXPORT
DF_Attribute
NewEmpty () const
virtual Standard_EXPORT void Paste (DF_Attribute *theIntoAttribute)
Standard_EXPORT DF_Label Label () const
Standard_EXPORT DF_AttributeFindAttribute (const std::string &theID) const
virtual Standard_EXPORT std::string Save ()
virtual Standard_EXPORT void Load (const std::string &)
virtual Standard_EXPORT void AfterAddition ()
virtual Standard_EXPORT void BeforeForget ()

Static Public Member Functions

static Standard_EXPORT const
std::string & 
GetID ()
static Standard_EXPORT
DF_Container
Set (DF_Label &theLabel)

Protected Member Functions

void Backup ()

Protected Attributes

std::map< std::string, int > _ints
std::map< std::string, double > _doubles
std::map< std::string,
std::string > 
_strings
std::map< std::string, bool_bools
DF_LabelNode_node

Friends

class DF_Label

Detailed Description

Definition at line 29 of file DF_Container.hxx.


Constructor & Destructor Documentation

Definition at line 44 of file DF_Container.cxx.

{
  _ints.clear();
  _doubles.clear();
  _bools.clear();
  _strings.clear();
}

Here is the caller graph for this function:

Definition at line 53 of file DF_Container.cxx.

{
  _ints.clear();
  _doubles.clear();
  _bools.clear();
  _strings.clear();
}

Member Function Documentation

virtual Standard_EXPORT void DF_Attribute::AfterAddition ( ) [inline, virtual, inherited]

Reimplemented in SALOMEDSIMPL_EXPORT.

Definition at line 68 of file DF_Attribute.hxx.

{}

Here is the caller graph for this function:

void DF_Attribute::Backup ( ) [inline, protected, inherited]

Definition at line 72 of file DF_Attribute.hxx.

{}
virtual Standard_EXPORT void DF_Attribute::BeforeForget ( ) [inline, virtual, inherited]

Reimplemented in SALOMEDSIMPL_EXPORT.

Definition at line 69 of file DF_Attribute.hxx.

{}

Here is the caller graph for this function:

Definition at line 144 of file DF_Container.cxx.

{
  _ints.clear();
  _doubles.clear();
  _strings.clear();
  _bools.clear();
}

Here is the caller graph for this function:

DF_Attribute * DF_Attribute::FindAttribute ( const std::string &  theID) const [inherited]

Definition at line 54 of file DF_Attribute.cxx.

{
  if(!_node) return NULL;
  return Label().FindAttribute(theID);
}

Here is the call graph for this function:

bool DF_Container::GetBool ( const std::string &  theID)

Definition at line 130 of file DF_Container.cxx.

{
  if(!HasBoolID(theID)) return false;
  return _bools[theID];
}

Here is the call graph for this function:

double DF_Container::GetDouble ( const std::string &  theID)

Definition at line 90 of file DF_Container.cxx.

{
  if(!HasDoubleID(theID)) return 0.0;
  return _doubles[theID];
}

Here is the call graph for this function:

const std::string & DF_Container::GetID ( ) [static]

Definition at line 25 of file DF_Container.cxx.

{
  static std::string id = "DF_Container_srn";
  return id;
}

Here is the caller graph for this function:

int DF_Container::GetInt ( const std::string &  theID)

Definition at line 68 of file DF_Container.cxx.

{
  if(!HasIntID(theID)) 
    return 0;
  return _ints[theID];
}

Here is the call graph for this function:

std::string DF_Container::GetString ( const std::string &  theID)

Definition at line 110 of file DF_Container.cxx.

{
  if(!HasStringID(theID)) return "";
  return _strings[theID];
}

Here is the call graph for this function:

bool DF_Container::HasBoolID ( const std::string &  theID)

Definition at line 137 of file DF_Container.cxx.

{
  if(_bools.find(theID) != _bools.end()) return true;
  return false;
}

Here is the caller graph for this function:

bool DF_Container::HasDoubleID ( const std::string &  theID)

Definition at line 97 of file DF_Container.cxx.

{
  if(_doubles.find(theID) != _doubles.end()) return true;
  return false;
}

Here is the caller graph for this function:

bool DF_Container::HasIntID ( const std::string &  theID)

Definition at line 76 of file DF_Container.cxx.

{
  if(_ints.find(theID) != _ints.end()) return true;
  return false;
}

Here is the caller graph for this function:

bool DF_Container::HasStringID ( const std::string &  theID)

Definition at line 117 of file DF_Container.cxx.

{
  if(_strings.find(theID) != _strings.end()) return true;
  return false;
}

Here is the caller graph for this function:

const std::string & DF_Container::ID ( ) const [virtual]

Implements DF_Attribute.

Definition at line 153 of file DF_Container.cxx.

{
  return GetID();
}

Here is the call graph for this function:

DF_Label DF_Attribute::Label ( ) const [inherited]

Definition at line 48 of file DF_Attribute.cxx.

{
   return DF_Label(_node);
}

Here is the caller graph for this function:

virtual Standard_EXPORT void DF_Attribute::Load ( const std::string &  ) [inline, virtual, inherited]
DF_Attribute * DF_Container::NewEmpty ( ) const [virtual]

Implements DF_Attribute.

Definition at line 184 of file DF_Container.cxx.

{
  return new DF_Container();
}

Here is the call graph for this function:

void DF_Container::Paste ( DF_Attribute theIntoAttribute) [virtual]

Implements DF_Attribute.

Definition at line 190 of file DF_Container.cxx.

{
  DF_Container* attr = dynamic_cast<DF_Container*>(theIntoAttribute);
  if(!attr) return;  

  attr->Clear();

  typedef std::map<std::string, int>::const_iterator SI;
  for(SI p = _ints.begin(); p != _ints.end(); p++) 
    attr->_ints[p->first] = p->second;

  typedef std::map<std::string, double>::const_iterator SD;
  for(SD p = _doubles.begin(); p != _doubles.end(); p++) 
    attr->_doubles[p->first] = p->second;

  typedef std::map<std::string, std::string>::const_iterator SS;
  for(SS p = _strings.begin(); p != _strings.end(); p++) 
    attr->_strings[p->first] = p->second;

  typedef std::map<std::string, bool>::const_iterator SB;
  for(SB p = _bools.begin(); p != _bools.end(); p++) 
   attr-> _bools[p->first] = p->second;
}

Here is the call graph for this function:

void DF_Container::Restore ( DF_Attribute theAttribute) [virtual]

Implements DF_Attribute.

Definition at line 159 of file DF_Container.cxx.

{
  Clear();

  DF_Container* attr = dynamic_cast<DF_Container*>(theAttribute);
  if(!attr) return;

  typedef std::map<std::string, int>::const_iterator SI;
  for(SI p = attr->_ints.begin(); p != attr->_ints.end(); p++) 
    _ints[p->first] = p->second;

  typedef std::map<std::string, double>::const_iterator SD;
  for(SD p = attr->_doubles.begin(); p != attr->_doubles.end(); p++) 
    _doubles[p->first] = p->second;

  typedef std::map<std::string, std::string>::const_iterator SS;
  for(SS p = attr->_strings.begin(); p != attr->_strings.end(); p++) 
    _strings[p->first] = p->second;

  typedef std::map<std::string, bool>::const_iterator SB;
  for(SB p = attr->_bools.begin(); p != attr->_bools.end(); p++) 
    _bools[p->first] = p->second;
}

Here is the call graph for this function:

virtual Standard_EXPORT std::string DF_Attribute::Save ( ) [inline, virtual, inherited]
DF_Container * DF_Container::Set ( DF_Label theLabel) [static]

Definition at line 32 of file DF_Container.cxx.

{
  DF_Attribute* attr = NULL;
  if(!(attr = theLabel.FindAttribute(DF_Container::GetID()))) {
    attr = new DF_Container;
    theLabel.AddAttribute(attr);
  }
  
  return dynamic_cast<DF_Container*>(attr);
}

Here is the call graph for this function:

void DF_Container::SetBool ( const std::string &  theID,
bool  theValue 
)

Definition at line 124 of file DF_Container.cxx.

{
  _bools[theID] = theValue;
}
void DF_Container::SetDouble ( const std::string &  theID,
const double &  theValue 
)

Definition at line 83 of file DF_Container.cxx.

{
  _doubles[theID] = theValue;
}
void DF_Container::SetInt ( const std::string &  theID,
int  theValue 
)

Definition at line 62 of file DF_Container.cxx.

{
  _ints[theID] = theValue;
}
void DF_Container::SetString ( const std::string &  theID,
const std::string &  theValue 
)

Definition at line 104 of file DF_Container.cxx.

{
  _strings[theID] = theValue;
}

Friends And Related Function Documentation

friend class DF_Label [friend, inherited]

Definition at line 75 of file DF_Attribute.hxx.


Member Data Documentation

std::map<std::string, bool> DF_Container::_bools [protected]

Definition at line 101 of file DF_Container.hxx.

std::map<std::string, double> DF_Container::_doubles [protected]

Definition at line 99 of file DF_Container.hxx.

std::map<std::string, int> DF_Container::_ints [protected]

Definition at line 98 of file DF_Container.hxx.

DF_LabelNode* DF_Attribute::_node [protected, inherited]

Reimplemented in SALOMEDSIMPL_EXPORT.

Definition at line 32 of file DF_Attribute.hxx.

std::map<std::string, std::string> DF_Container::_strings [protected]

Definition at line 100 of file DF_Container.hxx.


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