Open CASCADE Technology  7.0.0
Public Member Functions

Dico_DictionaryOfInteger Class Reference

#include <Dico_DictionaryOfInteger.hxx>

Inheritance diagram for Dico_DictionaryOfInteger:
Inheritance graph
[legend]

Public Member Functions

 Dico_DictionaryOfInteger ()
 Creates a Dictionary cell. A Dictionary is always created then handled by its first cell After creating a Dictionary, user can call methods HasItem, Item, SetItem ... (internal cells and entries are also defined as objects from the same class) Also iteration can be made, by an Iterator on this Dictionary. More...
 
Standard_Boolean HasItem (const Standard_CString name, const Standard_Boolean exact=Standard_False) const
 Returns True if an Item is bound to a Name in the Dictionnary <exact> : if True, commands exact matching if False, accept completion, only if ONE AND ONLY ONE Dictionnary Entry has <name> as beginning of its name. More...
 
Standard_Boolean HasItem (const TCollection_AsciiString &name, const Standard_Boolean exact=Standard_True) const
 Works as above method but accepts a String from TCollection. More...
 
const Standard_IntegerItem (const Standard_CString name, const Standard_Boolean exact=Standard_True) const
 Returns item bound to a name in the Dictionnary <exact> : same as for HasItem. More...
 
const Standard_IntegerItem (const TCollection_AsciiString &name, const Standard_Boolean exact=Standard_True) const
 Works as above method but accepts a String from TCollection. More...
 
Standard_Boolean GetItem (const Standard_CString name, Standard_Integer &anitem, const Standard_Boolean exact=Standard_True) const
 Gathers HasItem and Item, in a less regular but faster way If return is True, <anitem> is returned too, else it is not <exact> : same as for HasItem. More...
 
Standard_Boolean GetItem (const TCollection_AsciiString &name, Standard_Integer &anitem, const Standard_Boolean exact=Standard_True) const
 Works as above method but accepts a String from TCollection. More...
 
void SetItem (const Standard_CString name, const Standard_Integer &anitem, const Standard_Boolean exact=Standard_True)
 Binds an item to a dictionnary entry If <name> is already known in the dictionary, its value is changed. Else, the dictionary entry is created. If <exact> is given False, completion is tried, it is accepted If it gives a UNIQUE entry : hence this one will be modified Else, new entry is created with the exact name given. More...
 
void SetItem (const TCollection_AsciiString &name, const Standard_Integer &anitem, const Standard_Boolean exact=Standard_True)
 Works as above method but accepts a String from TCollection. More...
 
Standard_IntegerNewItem (const Standard_CString name, Standard_Boolean &isvalued, const Standard_Boolean exact=Standard_True)
 Returns the Item AS AN ADDRESS which corresponds to a Name, in order to be changed or set. If this name is not yet recorded, the Dictionary creates it. <isvalued> is returned True if the Item is recorded in the Dictionary, False else, in that case the Item is reserved and the name is noted as beeing valued now. More...
 
Standard_IntegerNewItem (const TCollection_AsciiString &name, Standard_Boolean &isvalued, const Standard_Boolean exact=Standard_True)
 Works as above method but accepts a String from TCollection. More...
 
Standard_Boolean RemoveItem (const Standard_CString name, const Standard_Boolean cln=Standard_True, const Standard_Boolean exact=Standard_True)
 Removes a dictionary entry given by its name then Returns True If the entry does not exists, Does nothing then Returns False <exact> : as for HasItem, if completion works, the found entry is removed (else returned value is False) <cln> commands cleaning dictionary (to recover memory space) For an isolated call, it is recommanded to give it at True For a sequence of calls, rather give False, then call Clean. More...
 
Standard_Boolean RemoveItem (const TCollection_AsciiString &name, const Standard_Boolean cln=Standard_True, const Standard_Boolean exact=Standard_True)
 Works as above method but accepts a String from TCollection. More...
 
void Clean ()
 Deletes physically in one step the entries which were removed (can be used for a more efficient Memory Management : first Remove several Items (<cln> = False), then Clean the Memory) More...
 
Standard_Boolean IsEmpty () const
 Returns True if no Item is recorded. More...
 
void Clear ()
 Clears all the Dictionary : all recorded Items are removed. More...
 
Handle< Dico_DictionaryOfIntegerCopy () const
 Copies the Dictionary as a Tree, without Copying the Items. More...
 
Standard_Boolean Complete (Handle< Dico_DictionaryOfInteger > &acell) const
 Internal routine used for completion (returns True if success) More...
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const override
 Memory deallocator for transient classes. More...
 
- Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor. More...
 
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing. More...
 
Standard_Transientoperator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter. More...
 
virtual ~Standard_Transient ()
 Destructor must be virtual. More...
 
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object. More...
 
Standard_Boolean IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type. More...
 
Standard_Boolean IsInstance (const Standard_CString theTypeName) const
 Returns a true value if this is an instance of TypeName. More...
 
Standard_Boolean IsKind (const opencascade::handle< Standard_Type > &theType) const
 Returns true if this is an instance of Type or an instance of any class that inherits from Type. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_Boolean IsKind (const Standard_CString theTypeName) const
 Returns true if this is an instance of TypeName or an instance of any class that inherits from TypeName. Note that multiple inheritance is not supported by OCCT RTTI mechanism. More...
 
Standard_TransientThis () const
 Returns non-const pointer to this object (like const_cast). For protection against creating handle to objects allocated in stack or call from constructor, it will raise exception Standard_ProgramError if reference counter is zero. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 
void IncrementRefCounter () const
 Increments the reference counter of this object. More...
 
Standard_Integer DecrementRefCounter () const
 Decrements the reference counter of this object; returns the decremented value. More...
 

Additional Inherited Members

- Public Types inherited from Standard_Transient
typedef void base_type
 Returns a type descriptor about this object. More...
 
- Static Public Member Functions inherited from Standard_Transient
static const char * get_type_name ()
 Returns a type descriptor about this object. More...
 
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class. More...
 

Constructor & Destructor Documentation

Dico_DictionaryOfInteger::Dico_DictionaryOfInteger ( )

Creates a Dictionary cell. A Dictionary is always created then handled by its first cell After creating a Dictionary, user can call methods HasItem, Item, SetItem ... (internal cells and entries are also defined as objects from the same class) Also iteration can be made, by an Iterator on this Dictionary.

Member Function Documentation

void Dico_DictionaryOfInteger::Clean ( )

Deletes physically in one step the entries which were removed (can be used for a more efficient Memory Management : first Remove several Items (<cln> = False), then Clean the Memory)

void Dico_DictionaryOfInteger::Clear ( )

Clears all the Dictionary : all recorded Items are removed.

Standard_Boolean Dico_DictionaryOfInteger::Complete ( Handle< Dico_DictionaryOfInteger > &  acell) const

Internal routine used for completion (returns True if success)

Handle< Dico_DictionaryOfInteger > Dico_DictionaryOfInteger::Copy ( ) const

Copies the Dictionary as a Tree, without Copying the Items.

Standard_Boolean Dico_DictionaryOfInteger::GetItem ( const Standard_CString  name,
Standard_Integer anitem,
const Standard_Boolean  exact = Standard_True 
) const

Gathers HasItem and Item, in a less regular but faster way If return is True, <anitem> is returned too, else it is not <exact> : same as for HasItem.

Standard_Boolean Dico_DictionaryOfInteger::GetItem ( const TCollection_AsciiString name,
Standard_Integer anitem,
const Standard_Boolean  exact = Standard_True 
) const

Works as above method but accepts a String from TCollection.

Standard_Boolean Dico_DictionaryOfInteger::HasItem ( const Standard_CString  name,
const Standard_Boolean  exact = Standard_False 
) const

Returns True if an Item is bound to a Name in the Dictionnary <exact> : if True, commands exact matching if False, accept completion, only if ONE AND ONLY ONE Dictionnary Entry has <name> as beginning of its name.

Standard_Boolean Dico_DictionaryOfInteger::HasItem ( const TCollection_AsciiString name,
const Standard_Boolean  exact = Standard_True 
) const

Works as above method but accepts a String from TCollection.

Standard_Boolean Dico_DictionaryOfInteger::IsEmpty ( ) const

Returns True if no Item is recorded.

const Standard_Integer& Dico_DictionaryOfInteger::Item ( const Standard_CString  name,
const Standard_Boolean  exact = Standard_True 
) const

Returns item bound to a name in the Dictionnary <exact> : same as for HasItem.

const Standard_Integer& Dico_DictionaryOfInteger::Item ( const TCollection_AsciiString name,
const Standard_Boolean  exact = Standard_True 
) const

Works as above method but accepts a String from TCollection.

Standard_Integer& Dico_DictionaryOfInteger::NewItem ( const Standard_CString  name,
Standard_Boolean isvalued,
const Standard_Boolean  exact = Standard_True 
)

Returns the Item AS AN ADDRESS which corresponds to a Name, in order to be changed or set. If this name is not yet recorded, the Dictionary creates it. <isvalued> is returned True if the Item is recorded in the Dictionary, False else, in that case the Item is reserved and the name is noted as beeing valued now.

Standard_Integer& Dico_DictionaryOfInteger::NewItem ( const TCollection_AsciiString name,
Standard_Boolean isvalued,
const Standard_Boolean  exact = Standard_True 
)

Works as above method but accepts a String from TCollection.

Standard_Boolean Dico_DictionaryOfInteger::RemoveItem ( const Standard_CString  name,
const Standard_Boolean  cln = Standard_True,
const Standard_Boolean  exact = Standard_True 
)

Removes a dictionary entry given by its name then Returns True If the entry does not exists, Does nothing then Returns False <exact> : as for HasItem, if completion works, the found entry is removed (else returned value is False) <cln> commands cleaning dictionary (to recover memory space) For an isolated call, it is recommanded to give it at True For a sequence of calls, rather give False, then call Clean.

Standard_Boolean Dico_DictionaryOfInteger::RemoveItem ( const TCollection_AsciiString name,
const Standard_Boolean  cln = Standard_True,
const Standard_Boolean  exact = Standard_True 
)

Works as above method but accepts a String from TCollection.

void Dico_DictionaryOfInteger::SetItem ( const Standard_CString  name,
const Standard_Integer anitem,
const Standard_Boolean  exact = Standard_True 
)

Binds an item to a dictionnary entry If <name> is already known in the dictionary, its value is changed. Else, the dictionary entry is created. If <exact> is given False, completion is tried, it is accepted If it gives a UNIQUE entry : hence this one will be modified Else, new entry is created with the exact name given.

void Dico_DictionaryOfInteger::SetItem ( const TCollection_AsciiString name,
const Standard_Integer anitem,
const Standard_Boolean  exact = Standard_True 
)

Works as above method but accepts a String from TCollection.


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