commore  1.0.6-SNAPSHOT
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SymbolType.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2006-2007 Raphael David / CANTOR
3 //
4 
5 #ifndef CMR_SYMBOL_TYPE_INCLUDED
6 #define CMR_SYMBOL_TYPE_INCLUDED
7 
8 #include "commore/Commore.h"
9 #include "commore/Symbol.h"
10 
11 
12 namespace commore
13 {
14  //
15  // A SymbolType is a lightweight service that contains three informations :
16  // the type of an attribute, the name of this attribute, and a flag indicating
17  // whether this attribute is a reference or not.
18  // Used in a Tuple::Value.
19  //
20  class SymbolType
21  {
22  public:
23  SymbolType();
24  SymbolType(unsigned int val);
25  SymbolType(Types type, const Symbol& symbol, bool ref);
26 
27  public:
28  Types get_type() const;
29  void set_type(Types type);
30  Symbol get_symbol() const;
31  size_t get_symbol_num() const;
32  void set_symbol(const Symbol& symbol);
33  bool get_is_ref() const;
34  void set_is_ref(bool ref);
35  bool get_is_const() const;
36  void set_is_const(bool cst);
37  unsigned int get_val() const;
38  bool operator == (const SymbolType& st) const
39  {
40  return val_ == st.val_;
41  }
42  bool operator != (const SymbolType& st) const
43  {
44  return val_ != st.val_;
45  }
46 
47  private:
48  unsigned int val_;
49  };
50 }
51 #endif
void set_type(Types type)
Definition: SymbolType.cpp:42
Types get_type() const
Definition: SymbolType.cpp:35
bool operator==(const SymbolType &st) const
Definition: SymbolType.h:38
Definition: Symbol.h:18
Definition: SymbolType.h:20
Symbol get_symbol() const
Definition: SymbolType.cpp:50
bool operator!=(const SymbolType &st) const
Definition: SymbolType.h:42
void set_is_ref(bool ref)
Definition: SymbolType.cpp:83
bool get_is_ref() const
Definition: SymbolType.cpp:76
void set_symbol(const Symbol &symbol)
Definition: SymbolType.cpp:63
void set_is_const(bool cst)
Definition: SymbolType.cpp:105
bool get_is_const() const
Definition: SymbolType.cpp:98
unsigned int get_val() const
Definition: SymbolType.cpp:71
size_t get_symbol_num() const
Definition: SymbolType.cpp:57
SymbolType()
Definition: SymbolType.cpp:14
Types
Definition: Type.h:131