EMdFValue

Overview

EMdFValue is returned from MatchedObject::getEMdFValue(). It holds an EMdF value, i.e., one of the following:

  • Integer
  • ID_D
  • String
  • Enum
  • List of Integer (IntegerList).
  • List of ID_D

Enums

The enum constants returned are integers, both for kEVEnum and kEVListOfInteger (which is also used for lists of enum constants). You must use EmdrosEnv::getEnumConstNameFromValue()

in order to retrieve the string-form of the enum.

C++ interface


#include <emdf_value.h>

typedef enum {
  kEVInt,
  kEVEnum,
  kEVID_D,
  kEVString,
  kEVListOfInteger, // Also used for enums
  kEVListOfID_D
} eEVkind;

class EMdFValue {
public: 
  // Copy-constructor
  EMdFValue(const EMdFValue& other);

  // kind must be kEVInt, kEVEnum or kEVID_D
  EMdFValue(eEVkind kind, long i);

  // kind becomes kEVString
  EMdFValue(const std::string& str);

  // Kind must be kEVListOfInteger or kEVListOfID_D
  EMdFValue(eEVkind kind, IntegerList *pIntegerList);

  ~EMdFValue();

  // Get kind
  eEVkind getKind(void) const;

  // Get if it is a string
  const std::string getString(void) const;

  // Get if it is an ID_D
  id_d_t getID_D(void) const;

  // Get if it is an integer
  long getInt(void) const;

  // Get if it is an enum
  long getEnum(void) const;

  // Get if it is kEVListOfInteger or kEVListOfID_D
  IntegerList *getIntegerList(void) const;

  // Get a string representation
  void toString(std::string& result) const;

  // Change string-value. Must be kEVString
  void changeString(const std::string&newString);

  // Assignment operator
  EMdFValue& operator=(const EMdFValue& other); // Not SWIG-wrapped
};



Previous:Sheaf
Up:Part II: APIs
Next:MQLResult