Open CASCADE Technology Reference Manual 8.0.2
Loading...
Searching...
No Matches
PCDM_ReaderFilter Class Reference

Class represents a document reading filter. More...

#include <PCDM_ReaderFilter.hxx>

Inheritance diagram for PCDM_ReaderFilter:

Public Types

enum  AppendMode { AppendMode_Forbid = 0 , AppendMode_Protect = 1 , AppendMode_Overwrite = 2 }
 Supported modes of appending the file content into existing document. More...
typedef void base_type
 Returns a type descriptor about this object.

Public Member Functions

 PCDM_ReaderFilter ()
 Creates an empty filter, so, all will be retrieved if nothing else is defined.
 PCDM_ReaderFilter (const occ::handle< Standard_Type > &theSkipped)
 Creates a filter to skip only one type of attributes.
 PCDM_ReaderFilter (const TCollection_AsciiString &theEntryToRead)
 Creates a filter to read only sub-labels of a label-path. Like, for "0:2" it will read all attributes for labels "0:2", "0:2:1", etc.
 PCDM_ReaderFilter (const AppendMode theAppend)
 Creates a filter to append the content of file to open to existing document.
 ~PCDM_ReaderFilter () override
 Destructor for the filter content.
void AddSkipped (const occ::handle< Standard_Type > &theSkipped)
 Adds skipped attribute by type.
void AddSkipped (const TCollection_AsciiString &theSkipped)
 Adds skipped attribute by type name.
void AddRead (const occ::handle< Standard_Type > &theRead)
 Adds attribute to read by type. Disables the skipped attributes added.
void AddRead (const TCollection_AsciiString &theRead)
 Adds attribute to read by type name. Disables the skipped attributes added.
void AddPath (const TCollection_AsciiString &theEntryToRead)
 Adds sub-tree path (like "0:2").
void Clear ()
 Makes filter pass all data.
virtual bool IsPassed (const occ::handle< Standard_Type > &theAttributeID) const
 Returns true if attribute must be read.
virtual bool IsPassedAttr (const TCollection_AsciiString &theAttributeType) const
 Returns true if attribute must be read.
virtual bool IsPassed (const TCollection_AsciiString &theEntry) const
 Returns true if content of the label must be read.
virtual bool IsSubPassed (const TCollection_AsciiString &theEntry) const
 Returns true if some sub-label of the given label is passed.
virtual bool IsPartTree ()
 Returns true if only part of the document tree will be retrieved.
AppendMode & Mode ()
 Returns the append mode.
bool IsAppendMode ()
 Returns true if appending to the document is performed.
virtual void StartIteration ()
 Starts the tree iterator. It is used for fast searching of passed labels if the whole tree of labels is parsed. So, on each iteration step the methods Up and Down must be called after the iteration start.
virtual void Up ()
 Iteration to the child label.
virtual void Down (const int &theTag)
 Iteration to the child with defined tag.
virtual bool IsPassed () const
 Returns true if content of the currently iterated label must be read.
virtual bool IsSubPassed () const
 Returns true if some sub-label of the currently iterated label is passed.
Public Member Functions inherited from Standard_Transient
 Standard_Transient ()
 Empty constructor.
 Standard_Transient (const Standard_Transient &)
 Copy constructor – does nothing.
Standard_Transient & operator= (const Standard_Transient &)
 Assignment operator, needed to avoid copying reference counter.
virtual ~Standard_Transient ()=default
 Destructor must be virtual.
virtual const opencascade::handle< Standard_Type > & DynamicType () const
 Returns a type descriptor about this object.
bool IsInstance (const opencascade::handle< Standard_Type > &theType) const
 Returns a true value if this is an instance of Type.
bool IsInstance (const char *const theTypeName) const
 Returns a true value if this is an instance of TypeName.
bool 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.
bool IsKind (const char *const 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.
Standard_Transient * This () 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.
int GetRefCount () const noexcept
 Get the reference counter of this object.
void IncrementRefCounter () noexcept
 Increments the reference counter of this object. Uses relaxed memory ordering since incrementing only requires atomicity, not synchronization with other memory operations.
int DecrementRefCounter () noexcept
 Decrements the reference counter of this object; returns the decremented value. Uses release ordering for the decrement to ensure all writes to the object are visible before the count reaches zero. An acquire fence is added only when the count reaches zero, ensuring proper synchronization before deletion. This is more efficient than using acq_rel for every decrement.
virtual void Delete () const
 Memory deallocator for transient classes.

Protected Types

typedef NCollection_DataMap< int, void * > TagTree
 Map from tag of a label to sub-tree of this tag. Used for fast browsing the tree and compare with entities that must be read.

Protected Attributes

AppendMode myAppend
 Append mode for reading files into existing document.
NCollection_Map< TCollection_AsciiString > mySkip
 Class names of attributes that must be skipped during the read.
NCollection_Map< TCollection_AsciiString > myRead
 Class names of only attributes to read (if it is not empty, mySkip is unused)
NCollection_List< TCollection_AsciiString > mySubTrees
 Paths to the labels that must be read. If it is empty, read all.
TagTree myTree
 Whole tree that correspond to retrieved document.
TagTree * myCurrent
 Pointer to the current node of the iterator.
int myCurrentDepth
 If a node does not described in the read-entries, the iterator goes inside of this subtree just by keeping the depth of iteration.

Additional Inherited Members

static constexpr const char * get_type_name ()
 Returns a type descriptor about this object.
static const opencascade::handle< Standard_Type > & get_type_descriptor ()
 Returns type descriptor of Standard_Transient class.

Detailed Description

Class represents a document reading filter.

It allows to set attributes (by class names) that must be skipped during the document reading or attributes that must be retrieved only. In addition it is possible to define one or several subtrees (by entry) which must be retrieved during the reading. Other labels are created, but no one attribute on them.

Member Typedef Documentation

◆ TagTree

Map from tag of a label to sub-tree of this tag. Used for fast browsing the tree and compare with entities that must be read.

Member Enumeration Documentation

◆ AppendMode

Supported modes of appending the file content into existing document.

Enumerator
AppendMode_Forbid 

do not allow append, default mode

AppendMode_Protect 

keeps existing attributes, reads only new ones

AppendMode_Overwrite 

overwrites the existing attributes by the loaded ones

Constructor & Destructor Documentation

◆ PCDM_ReaderFilter() [1/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( )
inline

Creates an empty filter, so, all will be retrieved if nothing else is defined.

◆ PCDM_ReaderFilter() [2/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( const occ::handle< Standard_Type > & theSkipped)

Creates a filter to skip only one type of attributes.

◆ PCDM_ReaderFilter() [3/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( const TCollection_AsciiString & theEntryToRead)

Creates a filter to read only sub-labels of a label-path. Like, for "0:2" it will read all attributes for labels "0:2", "0:2:1", etc.

◆ PCDM_ReaderFilter() [4/4]

PCDM_ReaderFilter::PCDM_ReaderFilter ( const AppendMode theAppend)

Creates a filter to append the content of file to open to existing document.

◆ ~PCDM_ReaderFilter()

PCDM_ReaderFilter::~PCDM_ReaderFilter ( )
override

Destructor for the filter content.

Member Function Documentation

◆ AddPath()

void PCDM_ReaderFilter::AddPath ( const TCollection_AsciiString & theEntryToRead)
inline

Adds sub-tree path (like "0:2").

◆ AddRead() [1/2]

void PCDM_ReaderFilter::AddRead ( const occ::handle< Standard_Type > & theRead)
inline

Adds attribute to read by type. Disables the skipped attributes added.

◆ AddRead() [2/2]

void PCDM_ReaderFilter::AddRead ( const TCollection_AsciiString & theRead)
inline

Adds attribute to read by type name. Disables the skipped attributes added.

◆ AddSkipped() [1/2]

void PCDM_ReaderFilter::AddSkipped ( const occ::handle< Standard_Type > & theSkipped)
inline

Adds skipped attribute by type.

◆ AddSkipped() [2/2]

void PCDM_ReaderFilter::AddSkipped ( const TCollection_AsciiString & theSkipped)
inline

Adds skipped attribute by type name.

◆ Clear()

void PCDM_ReaderFilter::Clear ( )

Makes filter pass all data.

◆ Down()

virtual void PCDM_ReaderFilter::Down ( const int & theTag)
virtual

Iteration to the child with defined tag.

◆ IsAppendMode()

bool PCDM_ReaderFilter::IsAppendMode ( )
inline

Returns true if appending to the document is performed.

◆ IsPartTree()

virtual bool PCDM_ReaderFilter::IsPartTree ( )
virtual

Returns true if only part of the document tree will be retrieved.

◆ IsPassed() [1/3]

virtual bool PCDM_ReaderFilter::IsPassed ( ) const
virtual

Returns true if content of the currently iterated label must be read.

◆ IsPassed() [2/3]

virtual bool PCDM_ReaderFilter::IsPassed ( const occ::handle< Standard_Type > & theAttributeID) const
virtual

Returns true if attribute must be read.

◆ IsPassed() [3/3]

virtual bool PCDM_ReaderFilter::IsPassed ( const TCollection_AsciiString & theEntry) const
virtual

Returns true if content of the label must be read.

◆ IsPassedAttr()

virtual bool PCDM_ReaderFilter::IsPassedAttr ( const TCollection_AsciiString & theAttributeType) const
virtual

Returns true if attribute must be read.

◆ IsSubPassed() [1/2]

virtual bool PCDM_ReaderFilter::IsSubPassed ( ) const
virtual

Returns true if some sub-label of the currently iterated label is passed.

◆ IsSubPassed() [2/2]

virtual bool PCDM_ReaderFilter::IsSubPassed ( const TCollection_AsciiString & theEntry) const
virtual

Returns true if some sub-label of the given label is passed.

◆ Mode()

AppendMode & PCDM_ReaderFilter::Mode ( )
inline

Returns the append mode.

◆ StartIteration()

virtual void PCDM_ReaderFilter::StartIteration ( )
virtual

Starts the tree iterator. It is used for fast searching of passed labels if the whole tree of labels is parsed. So, on each iteration step the methods Up and Down must be called after the iteration start.

◆ Up()

virtual void PCDM_ReaderFilter::Up ( )
virtual

Iteration to the child label.

Field Documentation

◆ myAppend

AppendMode PCDM_ReaderFilter::myAppend
protected

Append mode for reading files into existing document.

◆ myCurrent

TagTree* PCDM_ReaderFilter::myCurrent
protected

Pointer to the current node of the iterator.

◆ myCurrentDepth

int PCDM_ReaderFilter::myCurrentDepth
protected

If a node does not described in the read-entries, the iterator goes inside of this subtree just by keeping the depth of iteration.

◆ myRead

NCollection_Map<TCollection_AsciiString> PCDM_ReaderFilter::myRead
protected

Class names of only attributes to read (if it is not empty, mySkip is unused)

◆ mySkip

NCollection_Map<TCollection_AsciiString> PCDM_ReaderFilter::mySkip
protected

Class names of attributes that must be skipped during the read.

◆ mySubTrees

NCollection_List<TCollection_AsciiString> PCDM_ReaderFilter::mySubTrees
protected

Paths to the labels that must be read. If it is empty, read all.

◆ myTree

TagTree PCDM_ReaderFilter::myTree
protected

Whole tree that correspond to retrieved document.


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