Source: OmApplicationNode.h
|
|
|
|
#ifndef OM_APPLICATION_NODE_H
#define OM_APPLICATION_NODE_H
/**
* The application node structure.
*
* This class provides a specialization of OmNode to implement the Application node construction.
* This corresponds to a function F applying to its arguments A[0..n].
* This is encoded as <OMA> F A0 ... An </OMA>
* The list of children must represent the enclosed sequence of <F, A0, ..., An>.
*/
class OmApplicationNode : public OmNode
{
public:
/**
* Default constructor.
*/
OmApplicationNode() {}
protected:
/**
* Copy constructor.
*/
OmApplicationNode(const OmApplicationNode & other_in)
: OmNode(other_in) {}
/**
* Destructor.
*/
virtual ~OmApplicationNode() {}
/**
* Implement access to the concrete type.
*/
virtual OmType typeImp() const {
return OmApplicationType; }
/**
* Implement the deep cloning.
*/
virtual OmNode * cloneImp() const {
return new OmApplicationNode(*this); }
/**
* Implement the writing to an output device.
*/
virtual void writeImp(OmOutputDevice & output_in) const {
output_in.writeApplication();
for (ConstIterator it=iterate(); !it.done(); it.next()) {
hibernate(output_in, it.get()); }
output_in.writeEndApplication(); }
/**
* Implement the reading from an input device.
*/
virtual void readImp(OmInputDevice & input_in) {
OmCommentCollector cc;
input_in.readApplication();
cc.collect(input_in);
OmType type;
input_in.readType(type);
while (type!=OmEndApplicationType) {
append(cc.uncollect(OmNode::resurrect(input_in)));
cc.collect(input_in);
input_in.readType(type); }
input_in.readEndApplication(); }
};
#endif // OM_APPLICATION_NODE_H
Generated by: root@localhost.localdomain on Tue Oct 12 21:02:30 199. |