Open CASCADE Technology  6.9.0
Public Member Functions | Static Public Member Functions | Protected Member Functions

Interface_FileReaderData Class Referenceabstract

This class defines services which permit to access Data issued from a File, in a form which does not depend of physical format : thus, each Record has an attached ParamList (to be managed) and resulting Entity. More...

#include <Interface_FileReaderData.hxx>

Inheritance diagram for Interface_FileReaderData:
Inheritance graph
[legend]

Public Member Functions

virtual Standard_Integer NbRecords () const
 Returns the count of registered records That is, value given for Initialization (can be redefined) More...
 
virtual Standard_Integer NbEntities () const
 Returns the count of entities. Depending of each norm, records can be Entities or SubParts (SubList in STEP, SubGroup in SET ...). NbEntities counts only Entities, not Subs Used for memory reservation in InterfaceModel Default implementation uses FindNextRecord Can be redefined into a more performant way. More...
 
virtual Standard_Integer FindNextRecord (const Standard_Integer num) const =0
 Determines the record number defining an Entity following a given record number. Specific to each sub-class of FileReaderData. Returning zero means no record found. More...
 
void InitParams (const Standard_Integer num)
 attaches an empty ParamList to a Record More...
 
void AddParam (const Standard_Integer num, const Standard_CString aval, const Interface_ParamType atype, const Standard_Integer nument=0)
 Adds a parameter to record no "num" and fills its fields (EntityNumber is optional) Warning : <aval> is assumed to be memory-managed elsewhere : it is NOT copied. This gives a best speed : strings remain stored in pages of characters. More...
 
void AddParam (const Standard_Integer num, const TCollection_AsciiString &aval, const Interface_ParamType atype, const Standard_Integer nument=0)
 Same as above, but gets a AsciiString from TCollection Remark that the content of the AsciiString is locally copied (because its content is most often lost after using) More...
 
void AddParam (const Standard_Integer num, const Interface_FileParameter &FP)
 Same as above, but gets a complete FileParameter Warning : Content of <FP> is NOT copied : its original address and space in memory are assumed to be managed elsewhere (see ParamSet) More...
 
void SetParam (const Standard_Integer num, const Standard_Integer nump, const Interface_FileParameter &FP)
 Sets a new value for a parameter of a record, given by : num : record number; nump : parameter number in the record. More...
 
Standard_Integer NbParams (const Standard_Integer num) const
 Returns count of parameters attached to record "num" If <num> = 0, returns the total recorded count of parameters. More...
 
Handle< Interface_ParamListParams (const Standard_Integer num) const
 Returns the complete ParamList of a record (read only) num = 0 to return the whole param list for the file. More...
 
const Interface_FileParameterParam (const Standard_Integer num, const Standard_Integer nump) const
 Returns parameter "nump" of record "num", as a complete FileParameter. More...
 
Interface_FileParameterChangeParam (const Standard_Integer num, const Standard_Integer nump)
 Same as above, but in order to be modified on place. More...
 
Interface_ParamType ParamType (const Standard_Integer num, const Standard_Integer nump) const
 Returns type of parameter "nump" of record "num" Returns literal value of parameter "nump" of record "num" was C++ : return const &. More...
 
Standard_CString ParamCValue (const Standard_Integer num, const Standard_Integer nump) const
 Same as above, but as a CString was C++ : return const. More...
 
Standard_Boolean IsParamDefined (const Standard_Integer num, const Standard_Integer nump) const
 Returns True if parameter "nump" of record "num" is defined (it is not if its type is ParamVoid) More...
 
Standard_Integer ParamNumber (const Standard_Integer num, const Standard_Integer nump) const
 Returns record number of an entity referenced by a parameter of type Ident; 0 if no EntityNumber has been determined Note that it is used to reference Entities but also Sublists (sublists are not objects, but internal descriptions) More...
 
const Handle
< Standard_Transient > & 
ParamEntity (const Standard_Integer num, const Standard_Integer nump) const
 Returns the StepEntity referenced by a parameter Error if none. More...
 
Standard_Integer ParamFirstRank (const Standard_Integer num) const
 Returns the absolute rank of the beginning of a record (its lsit is from ParamFirstRank+1 to ParamFirstRank+NbParams) More...
 
const Handle
< Standard_Transient > & 
BoundEntity (const Standard_Integer num) const
 Returns the entity bound to a record, set by SetEntities. More...
 
void BindEntity (const Standard_Integer num, const Handle< Standard_Transient > &ent)
 Binds an entity to a record. More...
 
void SetErrorLoad (const Standard_Boolean val)
 Sets the status "Error Load" on, to overside check fails <val> True : declares unloaded <val> False : declares loaded If not called before loading (see FileReaderTool), check fails give the status IsErrorLoad says if SetErrorLoad has been called by user ResetErrorLoad resets it (called by FileReaderTool) This allows to specify that the currently loaded entity remains unloaded (because of syntactic fail) More...
 
Standard_Boolean IsErrorLoad () const
 Returns True if the status "Error Load" has been set (to True or False) More...
 
Standard_Boolean ResetErrorLoad ()
 Returns the former value of status "Error Load" then resets it Used to read the status then ensure it is reset. More...
 
void Destroy ()
 Destructor (waiting for memory management) More...
 
 ~Interface_FileReaderData ()
 
- Public Member Functions inherited from MMgt_TShared
virtual void Delete () const
 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
Handle_Standard_Type & 
DynamicType () const
 Returns a type information object about this object. More...
 
Standard_Boolean IsInstance (const 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 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...
 
virtual Handle_Standard_Transient This () const
 Returns a Handle which references this object. Must never be called to objects created in stack. More...
 
Standard_Integer GetRefCount () const
 Get the reference counter of this object. More...
 

Static Public Member Functions

static Standard_Real Fastof (const Standard_CString str)
 Same spec.s as standard <atof> but 5 times faster. More...
 

Protected Member Functions

 Interface_FileReaderData (const Standard_Integer nbr, const Standard_Integer npar)
 Initializes arrays of Entities and of ParamLists attached to registered records <nbr> must be the maximum number of records to get (no way to extend it at run-time) : count entities and sub-entities ... <npar> is the total count of parameters (if it is not exact, it will be extented as necessary) More...
 
Interface_FileParameterChangeParameter (const Standard_Integer numpar)
 Returns a parameter given its absolute rank in the file in order to be consulted or modified in specilaized actions. More...
 
void ParamPosition (const Standard_Integer numpar, Standard_Integer &num, Standard_Integer &nump) const
 For a given absolute rank of parameter, determines the record to which its belongs, and the parameter number for it. More...
 

Detailed Description

This class defines services which permit to access Data issued from a File, in a form which does not depend of physical format : thus, each Record has an attached ParamList (to be managed) and resulting Entity.

Each Interface defines its own FileReaderData : on one hand by defining deferred methods given here, on the other hand by describing literal data and their accesses, with the help of basic classes such as String, Array1OfString, etc...

FileReaderData is used by a FileReaderTool, which is also specific of each Norm, to read an InterfaceModel of the Norm FileReaderData inherits TShared to be accessed by Handle : this allows FileReaderTool to define more easily the specific methods, and improves memory management.

Constructor & Destructor Documentation

Interface_FileReaderData::~Interface_FileReaderData ( )
inline
Interface_FileReaderData::Interface_FileReaderData ( const Standard_Integer  nbr,
const Standard_Integer  npar 
)
protected

Initializes arrays of Entities and of ParamLists attached to registered records <nbr> must be the maximum number of records to get (no way to extend it at run-time) : count entities and sub-entities ... <npar> is the total count of parameters (if it is not exact, it will be extented as necessary)

Hence, to each record can be bound an Entity and a list of Parameters. Each kind of FileReaderData can add other data, by having them in parallel (other arrays with same sizes) Else, it must manage binding between items and their data

Member Function Documentation

void Interface_FileReaderData::AddParam ( const Standard_Integer  num,
const Standard_CString  aval,
const Interface_ParamType  atype,
const Standard_Integer  nument = 0 
)

Adds a parameter to record no "num" and fills its fields (EntityNumber is optional) Warning : <aval> is assumed to be memory-managed elsewhere : it is NOT copied. This gives a best speed : strings remain stored in pages of characters.

void Interface_FileReaderData::AddParam ( const Standard_Integer  num,
const TCollection_AsciiString aval,
const Interface_ParamType  atype,
const Standard_Integer  nument = 0 
)

Same as above, but gets a AsciiString from TCollection Remark that the content of the AsciiString is locally copied (because its content is most often lost after using)

void Interface_FileReaderData::AddParam ( const Standard_Integer  num,
const Interface_FileParameter FP 
)

Same as above, but gets a complete FileParameter Warning : Content of <FP> is NOT copied : its original address and space in memory are assumed to be managed elsewhere (see ParamSet)

void Interface_FileReaderData::BindEntity ( const Standard_Integer  num,
const Handle< Standard_Transient > &  ent 
)

Binds an entity to a record.

const Handle< Standard_Transient >& Interface_FileReaderData::BoundEntity ( const Standard_Integer  num) const

Returns the entity bound to a record, set by SetEntities.

Interface_FileParameter& Interface_FileReaderData::ChangeParam ( const Standard_Integer  num,
const Standard_Integer  nump 
)

Same as above, but in order to be modified on place.

Interface_FileParameter& Interface_FileReaderData::ChangeParameter ( const Standard_Integer  numpar)
protected

Returns a parameter given its absolute rank in the file in order to be consulted or modified in specilaized actions.

void Interface_FileReaderData::Destroy ( )

Destructor (waiting for memory management)

static Standard_Real Interface_FileReaderData::Fastof ( const Standard_CString  str)
static

Same spec.s as standard <atof> but 5 times faster.

virtual Standard_Integer Interface_FileReaderData::FindNextRecord ( const Standard_Integer  num) const
pure virtual

Determines the record number defining an Entity following a given record number. Specific to each sub-class of FileReaderData. Returning zero means no record found.

Implemented in StepData_StepReaderData, and IGESData_IGESReaderData.

void Interface_FileReaderData::InitParams ( const Standard_Integer  num)

attaches an empty ParamList to a Record

Standard_Boolean Interface_FileReaderData::IsErrorLoad ( ) const

Returns True if the status "Error Load" has been set (to True or False)

Standard_Boolean Interface_FileReaderData::IsParamDefined ( const Standard_Integer  num,
const Standard_Integer  nump 
) const

Returns True if parameter "nump" of record "num" is defined (it is not if its type is ParamVoid)

virtual Standard_Integer Interface_FileReaderData::NbEntities ( ) const
virtual

Returns the count of entities. Depending of each norm, records can be Entities or SubParts (SubList in STEP, SubGroup in SET ...). NbEntities counts only Entities, not Subs Used for memory reservation in InterfaceModel Default implementation uses FindNextRecord Can be redefined into a more performant way.

Reimplemented in StepData_StepReaderData, and IGESData_IGESReaderData.

Standard_Integer Interface_FileReaderData::NbParams ( const Standard_Integer  num) const

Returns count of parameters attached to record "num" If <num> = 0, returns the total recorded count of parameters.

virtual Standard_Integer Interface_FileReaderData::NbRecords ( ) const
virtual

Returns the count of registered records That is, value given for Initialization (can be redefined)

const Interface_FileParameter& Interface_FileReaderData::Param ( const Standard_Integer  num,
const Standard_Integer  nump 
) const

Returns parameter "nump" of record "num", as a complete FileParameter.

Standard_CString Interface_FileReaderData::ParamCValue ( const Standard_Integer  num,
const Standard_Integer  nump 
) const

Same as above, but as a CString was C++ : return const.

const Handle< Standard_Transient >& Interface_FileReaderData::ParamEntity ( const Standard_Integer  num,
const Standard_Integer  nump 
) const

Returns the StepEntity referenced by a parameter Error if none.

Standard_Integer Interface_FileReaderData::ParamFirstRank ( const Standard_Integer  num) const

Returns the absolute rank of the beginning of a record (its lsit is from ParamFirstRank+1 to ParamFirstRank+NbParams)

Standard_Integer Interface_FileReaderData::ParamNumber ( const Standard_Integer  num,
const Standard_Integer  nump 
) const

Returns record number of an entity referenced by a parameter of type Ident; 0 if no EntityNumber has been determined Note that it is used to reference Entities but also Sublists (sublists are not objects, but internal descriptions)

void Interface_FileReaderData::ParamPosition ( const Standard_Integer  numpar,
Standard_Integer num,
Standard_Integer nump 
) const
protected

For a given absolute rank of parameter, determines the record to which its belongs, and the parameter number for it.

Handle< Interface_ParamList > Interface_FileReaderData::Params ( const Standard_Integer  num) const

Returns the complete ParamList of a record (read only) num = 0 to return the whole param list for the file.

Interface_ParamType Interface_FileReaderData::ParamType ( const Standard_Integer  num,
const Standard_Integer  nump 
) const

Returns type of parameter "nump" of record "num" Returns literal value of parameter "nump" of record "num" was C++ : return const &.

Standard_Boolean Interface_FileReaderData::ResetErrorLoad ( )

Returns the former value of status "Error Load" then resets it Used to read the status then ensure it is reset.

void Interface_FileReaderData::SetErrorLoad ( const Standard_Boolean  val)

Sets the status "Error Load" on, to overside check fails <val> True : declares unloaded <val> False : declares loaded If not called before loading (see FileReaderTool), check fails give the status IsErrorLoad says if SetErrorLoad has been called by user ResetErrorLoad resets it (called by FileReaderTool) This allows to specify that the currently loaded entity remains unloaded (because of syntactic fail)

void Interface_FileReaderData::SetParam ( const Standard_Integer  num,
const Standard_Integer  nump,
const Interface_FileParameter FP 
)

Sets a new value for a parameter of a record, given by : num : record number; nump : parameter number in the record.


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