UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
tr_header.hpp
1 /* tr_header.hpp */
2 /* $Id$ */
3 #ifndef __hds_db_tr_header_hpp
4 #define __hds_db_tr_header_hpp
5 
6 #include <cstddef>
7 #include <iostream>
8 #include <hds_db/base/tr_header_context.hpp>
9 
11 namespace hds
12 {
14  namespace db
15  {
17  class TrHeader
18  {
19  public:
20 
22  typedef std::vector<char> Data;
23 
25  TrHeader();
26 
27 
29  template <typename T>
30  const T& attr(TrHeaderAttrId id) const;
31 
33  template <typename T>
34  T& attr(TrHeaderAttrId id);
35 
38  size_t attrLength(TrHeaderAttrId id) const;
39 
40 
42  const std::string& name(TrHeaderAttrId id) const;
43 
45  const TrHeaderAttrType& type(TrHeaderAttrId id) const;
46 
48  size_t attrSize(TrHeaderAttrId id) const;
49 
51  size_t attrOffset(TrHeaderAttrId id) const;
52 
54  bool hasKey(TrHeaderAttrId id) const;
55 
56 
58  size_t size() const;
59 
60 
62  Data& data();
63 
65  const Data& data() const;
66 
67 
69  void info(std::ostream &stream = std::cout) const;
70 
71  private:
72 
74  TrHeaderContext m_context;
75 
77  Data m_data;
78 
79  };
80  }; // db
81 }; // hds
82 
83 #include "tr_header_inline.hpp"
84 
85 #endif /* __hds_db_tr_header_hpp */
size_t size() const
size_t attrOffset(TrHeaderAttrId id) const
bool hasKey(TrHeaderAttrId id) const
void info(std::ostream &stream=std::cout) const
size_t attrLength(TrHeaderAttrId id) const
Definition: tr_header_context.hpp:37
const T & attr(TrHeaderAttrId id) const
Definition: tr_header_inline.hpp:13
TrHeaderAttrId
Definition: tr_header_context.hpp:16
TrHeaderAttrType
Definition: tr_header_context.hpp:24
const TrHeaderAttrType & type(TrHeaderAttrId id) const
std::vector< char > Data
Definition: tr_header.hpp:22
const std::string & name(TrHeaderAttrId id) const
Definition: tr_header.hpp:17
size_t attrSize(TrHeaderAttrId id) const