text: #ifndef XTREME_COMMON_DIMENSION_NODE_TYPE_H_
  #define XTREME_COMMON_DIMENSION_NODE_TYPE_H_
  
  /*
   * Copyright (2012, 2013) JDS Uniphase.  All rights reserved.
   * 
   * Author: Mervyn ONG
   *
   * Designed by Bob ANDREWS and LIM Fung Chai.
   */
  
  #include <string>
  #include <functional>
  #include <boost/functional/hash.hpp>
  #include "xtreme/common/dimension/base.h"
  #include "xtreme/common/ofstream_handle.h"
  #include "xtreme/common/parsed_frame/user_eqpt_types.h"
  
  
  namespace xtreme {
  /*!
   * \brief Base class of all topology node type dimension classes.
   *
   * This is an abstract class.
   */
  class DimensionNodeType : public Dimension {
    public:
      explicit DimensionNodeType(DimensionType type) : Dimension(type, false) {}
  
      virtual ~DimensionNodeType() {}
  
      // Ok to allow the compiler to synthesize the copy constructor and copy assignment.
  
      // Do not define the clone and size pure virtual functions so that this is still
      // an abstract class that cannot be instantiated.
  
      virtual bool operator==(const Dimension& rhs) const {
          if (type_ != rhs.type()) {
              return false;
          }
          const DimensionNodeType* other = static_cast<const DimensionNodeType*>(&rhs);
          return this->operator==(*other);
      }
  
      bool operator==(const DimensionNodeType& rhs) const {
          if (node_type_.compare(rhs.node_type_) == 0)
              return true;
          return false;
      }
  
      virtual void setInvalidParameters() {};
  
      virtual size_t hash(bool first) const {
          return xtreme::refdata::hash_value(node_type_);
      }
  
      /*! Set the node type.  */
      void set_node_type(const User_eqpt::Topo_node_type &node_type) {
          node_type_ = node_type;
      }
  
      const User_eqpt::Topo_node_type& node_type() const { return node_type_; }
  
      virtual std::string csv_content() {
          if (!csv_computed_)
          {
              if (node_type_.isNull())
                  csv_content_string_ = invalid_str_;
              else
                  csv_content_string_ = ((std::string)node_type_);
              csv_computed_ = true;
          }
          return csv_content_string_;
      }
      virtual void csv_content(  xtreme::aggregator::OFStreamHandle& stream ) {
          if (!csv_computed_)
          {
              if (node_type_.isNull())
                  csv_content_string_ = invalid_str_;
              else
                  csv_content_string_ = ((std::string)node_type_);
              csv_computed_ = true;
          }
          stream.output( csv_content_string_ );
      }
  
    protected:
      User_eqpt::Topo_node_type node_type_;
  };  // class DimensionNodeType
  
  }   // namespace xtreme
  
  #endif  // XTREME_COMMON_DIMENSION_NODE_TYPE_H_
  