|
|
#ifndef OM_OBJECT_NODE_H #define OM_OBJECT_NODE_H /** * The object node structure. * * This class provides a specialization of OmNode to implement the Object node construction. * This corresponds to any OpenMath object X. * This is encoded as <OMOBJ> X </OMOBJ> * The list of children must represent the enclosed sequence of <X>. */ class OmObjectNode : public OmNode { public: /** * Default constructor. */ OmObjectNode() {} protected: /** * Copy constructor. */ OmObjectNode(const OmObjectNode & other_in) : OmNode(other_in) {} /** * Destructor. */ virtual ~OmObjectNode() {} /** * Implement access to the concrete type. */ virtual OmType typeImp() const { return OmObjectType; } /** * Implement the deep cloning. */ virtual OmNode * cloneImp() const { return new OmObjectNode(*this); } /** * Implement the writing to an output device. */ virtual void writeImp(OmOutputDevice & output_in) const { OmException::checkMalformedNode(count()!=1, "OmObjectNode must have exactly one argument"); output_in.writeObject(); hibernate(output_in, iterate().get()); output_in.writeEndObject(); } /** * Implement the reading from an input device. */ virtual void readImp(OmInputDevice & input_in) { OmCommentCollector cc; input_in.readObject(); cc.collect(input_in); append(cc.uncollect(OmNode::resurrect(input_in))); cc.collect(input_in); input_in.readEndObject(); } }; #endif // OM_OBJECT_NODE_H
Generated by: root@localhost.localdomain on Tue Oct 12 21:02:30 199. |