//////////////////////////////////////////////////////////////////////////////// /*! @file AttrName.h Class sAttrName. - Part of RANet - Research Assistant Net Library (based on ANSI C++). - Copyright(C) 1999-2013, Viktor E. Bursian, St.Petersburg, Russia. Viktor.Bursian@mail.ioffe.ru */////////////////////////////////////////////////////////////////////////////// #ifndef AttrName_H #define AttrName_H #include "Storable.h" namespace RA { //------------------------------------------------------------------------------ ANNOUNCE_CLASS(sAttrName) //---------------------------------------------------------------- sAttrName --- /*! An attribute name. */ class RANet_EXPORT sAttrName { public: //types enum eType {cNameless ,cNumeric ,cSymbolic }; public: virtual ~sAttrName (); sAttrName (); explicit sAttrName (integer number); explicit sAttrName (rcsString symbolic_name); explicit sAttrName (literal symbolic_name); eType Type () const; integer ToNumber () const; sString ToString () const; virtual sString Text () const; // visual representation for user // virtual sString TextWithoutTypeIndication () const; bool operator == (rcsAttrName) const; bool operator == (integer) const; bool operator == (rcsString) const; bool operator == (literal) const; bool operator != (rcsAttrName) const; bool operator != (integer) const; bool operator != (rcsString) const; bool operator != (literal) const; sAttrName (std::istream &); virtual void Store (std::ostream &) const; sAttrName (rcsAttrName); virtual rsAttrName operator = (rcsAttrName); private: //fields eType T; integer Numeric; sString Symbolic; #ifdef RANET_DEBUG public: static long int Counter; #endif }; inline sAttrName::eType sAttrName::Type () const { return T; } inline bool sAttrName::operator != (rcsAttrName other) const { return ! operator==(other); } inline bool sAttrName::operator != (integer number) const { return ! operator==(number); } inline bool sAttrName::operator != (rcsString string) const { return ! operator==(string); } inline bool sAttrName::operator != (literal l) const { return ! operator==(l); } //------------------------------------------------------------------------------ } //namespace RA #endif