Source: OmFloatNode.h


Annotated List
Files
Globals
Hierarchy
Index
#ifndef OM_FLOAT_NODE_H
#define OM_FLOAT_NODE_H

/**
 * The float final node structure.
 *
 * This class provides a specialization of OmFinalNode to implement the Float node construction.
 * This corresponds to a double precision floating-point number following the IEEE754-1985 standard.
 * This is encoded as <OMF dec="decimal_representation"/> or <OMF hex="hexadecimal_representation"/>
 * The list of children must always be empty.
 */
class OmFloatNode : public OmFinalNode
{
public:
  /**
   * Constructor (can be used as default).
   */
  explicit OmFloatNode(double value_in=0.0)
    : value_(value_in) {}

  /**
   * Get the value.
   */
  virtual double getValue() const {
    return value_; }

  /**
   * Set the value.
   */
  virtual void setValue(double value_in) {
    value_ = value_in; }
  
protected:
  /**
   * Copy constructor.
   */
  OmFloatNode(const OmFloatNode & other_in)
    : OmFinalNode(other_in),
      value_(other_in.value_) {}

  /**
   * Destructor.
   */
  virtual ~OmFloatNode() {}

  /**
   * Implement access to the concrete type.
   */
  virtual OmType typeImp() const {
    return OmFloatType; }

  /**
   * Implement the deep cloning.
   */
  virtual OmNode * cloneImp() const {
    return new OmFloatNode(*this); }

  /**
   * Implement the writing to an output device.
   */
  virtual void writeImp(OmOutputDevice & output_in) const {
    output_in.writeFloat(value_); }
  
  /**
   * Implement the reading from an input device.
   */
  virtual void readImp(OmInputDevice & input_in) {
    input_in.readFloat(value_); }
  
private:
  double value_;
};

#endif // OM_FLOAT_NODE_H

Generated by: root@localhost.localdomain on Tue Oct 12 21:02:30 199.