1
////////////////////////////////////////////////////////////////////////////////
2
/*! @file AttrNames.h Различные виды имён атрибутов.
3
- Part of RANet - Research Assistant Net Library (based on ANSI C++).
4
- Copyright(C) 1999-2010, Viktor E. Bursian, St.Petersburg, Russia.
5
Viktor.Bursian@mail.ioffe.ru
6
*///////////////////////////////////////////////////////////////////////////////
11
//------------------------------------------------------------------------------
14
ANNOUNCE_CLASS(sAttributeName)
16
typedef sString tAttrString;
17
typedef tAttrString & rtAttrString;
18
typedef const tAttrString & rctAttrString;
22
//------------------------------------------------------------------------------
24
class RANet_EXPORT sAtom
27
sAtom (literal identification);
34
static unsigned int Counter;
35
//! @todo{atoms} static map or set to prevent dublicates
36
//static std::string FindVisualId (unsigned int);
37
//static unsigned int FindId (std::string);
38
friend class sAttributeName;
41
//------------------------------------------------------------------------------
43
class RANet_EXPORT sAttributeName
47
static unsigned int Counter;
51
{NamelessAttr,NumericAttr
52
,AtomicAttr,SymbolicAttr};
56
{ IF_DEBUG(--Counter;) };
59
{ IF_DEBUG(++Counter;) };
60
sAttributeName (rcsAtom atom)
61
:T(AtomicAttr),AtomId(atom.Id)
62
{ IF_DEBUG(++Counter;) };
63
sAttributeName (unsigned int number)
64
:T(NumericAttr),Number(number)
65
{ IF_DEBUG(++Counter;) };
66
sAttributeName (rctAttrString symbolic_name);
67
sAttributeName (literal symbolic_name);
70
virtual sString Text () const; // visual representation for user
71
virtual sString TextWithoutTypeIndication () const;
72
operator unsigned int () const
74
bool operator == (rcsAttributeName) const;
75
bool operator == (const unsigned int &) const;
76
bool operator == (rctAttrString) const;
77
bool operator == (literal) const;
78
sAttributeName (rsObjectStream);
79
virtual void Store (rsObjectStream);
80
sAttributeName (rcsAttributeName);
81
virtual rsAttributeName operator = (rcsAttributeName);
87
tAttrString SymbolicName;
90
//------------------------------------------------------------------------------