Concept Record Iterator. More...
#include <gconceptrecord.h>
Public Member Functions | |
GConceptRecordIterator (GDoc *doc, const GConceptRecord &parent) | |
GDoc * | GetDoc (void) const |
const GConceptRecord & | GetRecord (void) const |
void | Parse (void) |
Private Member Functions | |
virtual void | Treat (GConceptRecord &child)=0 |
Private Attributes | |
GDoc * | Doc |
const GConceptRecord & | Record |
Detailed Description
Concept Record Iterator.
The GConceptRecordIterator class provides an iterator to parse all the child records of a given record. For each child record found, the Treat method is called.
Here is an example of a code that computes the total number of child records for a given record.
{
size_t& Nb;
public:
Iterator(GDoc* doc,const GConceptRecord& rec,size_t& nb)
: GConceptRecordIterator(doc,rec), Nb(nb) {}
{
}
};
// Suppose a record Rec of a document Doc
size_t Nb;
Iterator(Doc,Rec,Nb).Parse();
Constructor & Destructor Documentation
GConceptRecordIterator | ( | GDoc * | doc, |
const GConceptRecord & | parent | ||
) |
Constructor of the iterator.
- Parameters
-
doc Document. parent Parent record.
Member Function Documentation
GDoc* GetDoc | ( | void | ) | const |
Get the document corresponding to the record.
- Returns
- a pointer to a GDoc.
const GConceptRecord& GetRecord | ( | void | ) | const |
Get the record for which the children must be parsed.
- Returns
- a pointer to a GConceptRecord.
void Parse | ( | void | ) |
Parse the iterator.
|
privatepure virtual |
Method called for each child record found.
- Parameters
-
child Child record found.
Member Data Documentation
|
private |
Document corresponding to the record.
|
private |
Record for which the children must be parsed.