OCC Main Page | DataExchange | Toolkits | Packages | Class Hierarchy | Data Structures | File List | Data Fields | Globals

DataExchange
TKXSBase
Interface


Interface_IntList Class Reference

This class detains the data which describe a Graph. A Graph
has two lists, one for shared refs, one for sharing refs
(the reverses). Each list comprises, for each Entity of the
Model of the Graph, a list of Entities (shared or sharing).
In fact, entities are identified by their numbers in the Model
or Graph : this gives better performances.

A simple way to implement this is to instantiate a HArray1
with a HSequenceOfInteger : each Entity Number designates a
value, which is a Sequence (if it is null, it is considered as
empty : this is a little optimisation).

This class gives a more efficient way to implement this.
It has two lists (two arrays of integers), one to describe
list (empty, one value given immediately, or negated index in
the second list), one to store refs (pointed from the first
list). This is much more efficient than a list of sequences,
in terms of speed (especially for read) and of memory

An IntList can also be set to access data for a given entity
number, it then acts as a single sequence

Remark that if an IntList is created from another one, it can
be read, but if it is created without copying, it may not be
edited
.

#include <Interface_IntList.hxx>


Public Member Functions

void * operator new (size_t, void *anAddress)
void * operator new (size_t size)
void operator delete (void *anAddress)
Standard_EXPORT Interface_IntList ()
 Creates empty IntList.
.
Standard_EXPORT Interface_IntList (const Standard_Integer nbe)
 Creates an IntList for <nbe> entities
.
Standard_EXPORT Interface_IntList (const Interface_IntList &other, const Standard_Boolean copied)
 Creates an IntList from another one.
if <copied> is True, copies data
else, data are not copied, only the header object is
.
Standard_EXPORT void Initialize (const Standard_Integer nbe)
 Initialize IntList by number of entities.
.
Standard_EXPORT void Internals (Standard_Integer &nbrefs, Handle(TColStd_HArray1OfInteger)&ents, Handle(TColStd_HArray1OfInteger)&refs) const
 Returns internal values, used for copying
.
Standard_EXPORT Standard_Integer NbEntities () const
 Returns count of entities to be aknowledged
.
Standard_EXPORT void SetNbEntities (const Standard_Integer nbe)
 Changes the count of entities (ignored if decreased)
.
Standard_EXPORT void SetNumber (const Standard_Integer number)
 Sets an entity number as current (for read and fill)
.
Standard_EXPORT Standard_Integer Number () const
 Returns the current entity number
.
Standard_EXPORT Interface_IntList List (const Standard_Integer number, const Standard_Boolean copied=Standard_False) const
 Returns an IntList, identical to <me> but set to a specified
entity Number
By default, not copied (in order to be read)
Specified <copied> to produce another list and edit it
.
Standard_EXPORT void SetRedefined (const Standard_Boolean mode)
 Sets current entity list to be redefined or not
This is used in a Graph for redefinition list : it can be
disable (no redefinition, i.e. list is cleared), or enabled
(starts as empty). The original list has not to be "redefined"
.
Standard_EXPORT void Reservate (const Standard_Integer count)
 Makes a reservation for <count> references to be later
attached to the current entity. If required, it increases
the size of array used to store refs. Remark that if count is
less than two, it does nothing (because immediate storing)
.
Standard_EXPORT void Add (const Standard_Integer ref)
 Adds a reference (as an integer value, an entity number) to
the current entity number. Zero is ignored
.
Standard_EXPORT Standard_Integer Length () const
 Returns the count of refs attached to current entity number
.
Standard_EXPORT Standard_Boolean IsRedefined (const Standard_Integer num=0) const
 Returns True if the list for a number (default is taken as
current) is "redefined" (usefull for empty list)
.
Standard_EXPORT Standard_Integer Value (const Standard_Integer num) const
 Returns a reference number in the list for current number,
according to its rank
.
Standard_EXPORT Standard_Boolean Remove (const Standard_Integer num)
 Removes an item in the list for current number, given its rank
Returns True if done, False else
.
Standard_EXPORT void Clear ()
 Clears all data, hence each entity number has an empty list
.
Standard_EXPORT void AdjustSize (const Standard_Integer margin=0)
 Resizes lists to exact sizes. For list of refs, a positive
margin can be added.
.

Private Attributes

Standard_Integer thenbe
Standard_Integer thenbr
Standard_Integer thenum
Standard_Integer thecount
Standard_Integer therank
Handle_TColStd_HArray1OfInteger theents
Handle_TColStd_HArray1OfInteger therefs


Constructor & Destructor Documentation

Standard_EXPORT Interface_IntList::Interface_IntList  ) 
 

Standard_EXPORT Interface_IntList::Interface_IntList const Standard_Integer  nbe  ) 
 

Standard_EXPORT Interface_IntList::Interface_IntList const Interface_IntList other,
const Standard_Boolean  copied
 


Member Function Documentation

Standard_EXPORT void Interface_IntList::Add const Standard_Integer  ref  ) 
 

Standard_EXPORT void Interface_IntList::AdjustSize const Standard_Integer  margin = 0  ) 
 

Standard_EXPORT void Interface_IntList::Clear  ) 
 

Standard_EXPORT void Interface_IntList::Initialize const Standard_Integer  nbe  ) 
 

Standard_EXPORT void Interface_IntList::Internals Standard_Integer &  nbrefs,
Handle(TColStd_HArray1OfInteger)&  ents,
Handle(TColStd_HArray1OfInteger)&  refs
const
 

Standard_EXPORT Standard_Boolean Interface_IntList::IsRedefined const Standard_Integer  num = 0  )  const
 

Standard_EXPORT Standard_Integer Interface_IntList::Length  )  const
 

Standard_EXPORT Interface_IntList Interface_IntList::List const Standard_Integer  number,
const Standard_Boolean  copied = Standard_False
const
 

Standard_EXPORT Standard_Integer Interface_IntList::NbEntities  )  const
 

Standard_EXPORT Standard_Integer Interface_IntList::Number  )  const
 

void Interface_IntList::operator delete void *  anAddress  )  [inline]
 

void* Interface_IntList::operator new size_t  size  )  [inline]
 

void* Interface_IntList::operator new size_t  ,
void *  anAddress
[inline]
 

Standard_EXPORT Standard_Boolean Interface_IntList::Remove const Standard_Integer  num  ) 
 

Standard_EXPORT void Interface_IntList::Reservate const Standard_Integer  count  ) 
 

Standard_EXPORT void Interface_IntList::SetNbEntities const Standard_Integer  nbe  ) 
 

Standard_EXPORT void Interface_IntList::SetNumber const Standard_Integer  number  ) 
 

Standard_EXPORT void Interface_IntList::SetRedefined const Standard_Boolean  mode  ) 
 

Standard_EXPORT Standard_Integer Interface_IntList::Value const Standard_Integer  num  )  const
 


Field Documentation

Standard_Integer Interface_IntList::thecount [private]
 

Handle_TColStd_HArray1OfInteger Interface_IntList::theents [private]
 

Standard_Integer Interface_IntList::thenbe [private]
 

Standard_Integer Interface_IntList::thenbr [private]
 

Standard_Integer Interface_IntList::thenum [private]
 

Standard_Integer Interface_IntList::therank [private]
 

Handle_TColStd_HArray1OfInteger Interface_IntList::therefs [private]
 


The documentation for this class was generated from the following file:
Generated on Mon Aug 25 14:41:37 2008 for OpenCASCADE by  doxygen 1.4.1