UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
tr_header_context.hpp
1 /* tr_header_context.hpp */
2 /* $Id$ */
3 #ifndef __tr_header_context_hpp
4 #define __tr_header_context_hpp
5 
6 #include <string>
7 #include <vector>
8 
10 namespace hds
11 {
13  namespace db
14  {
17  {
18 #define __HDR_ATTR(id, type, length, has_key) id,
19 #include "tr_header_attributes.def"
20 #undef __HDR_ATTR
21  };
22 
25  {
31  };
32 
34  std::string toString(TrHeaderAttrType type);
35 
38  {
39  public:
40 
43  struct AttrContext
44  {
46  AttrContext(): id(TA_NMGL), type(TAT_CHAR), length(0),
47  size(0), has_key(false), offset(0)
48  {/* Nothing to do. */}
49 
51  bool isDummy() {return (0 == size);}
52 
55  std::string name;
56  size_t length;
57  size_t size;
58  bool has_key;
59  size_t offset;
60  };
61 
62 
65 
66 
68  size_t size() const;
69 
72  const AttrContext& operator()(const size_t id) const;
73 
74 
76  size_t getDataSize() const;
77 
78  private:
79 
81  size_t calc_header_data_size() const;
82 
84  std::vector<AttrContext> prepare_attr_context() const;
85  };
86  }; // db
87 }; // hds
88 
89 #endif /* tr_header_context.hpp */
size_t size() const
size_t length
Definition: tr_header_context.hpp:56
Definition: tr_header_context.hpp:29
size_t offset
Definition: tr_header_context.hpp:59
Definition: tr_header_context.hpp:26
size_t size
Definition: tr_header_context.hpp:57
Definition: tr_header_context.hpp:28
TrHeaderAttrId id
Definition: tr_header_context.hpp:53
Definition: tr_header_context.hpp:30
std::string toString(OpenMode mode)
bool isDummy()
Definition: tr_header_context.hpp:51
Definition: tr_header_context.hpp:37
std::string name
Definition: tr_header_context.hpp:55
TrHeaderAttrId
Definition: tr_header_context.hpp:16
size_t getDataSize() const
TrHeaderAttrType
Definition: tr_header_context.hpp:24
const AttrContext & operator()(const size_t id) const
Definition: tr_header_context.hpp:27
AttrContext()
Definition: tr_header_context.hpp:46
bool has_key
Definition: tr_header_context.hpp:58
Definition: tr_header_context.hpp:43
TrHeaderAttrType type
Definition: tr_header_context.hpp:54