1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef NL_PDS_COLUMN_H
18 #define NL_PDS_COLUMN_H
23 #include "nel/misc/types_nl.h"
24 #include <nel/misc/i_xml.h>
29 #include "../pd_lib/pd_server_utils.h"
30 #include "../pd_lib/pds_types.h"
37 * A column definition.
38 * Defines the kind of data stored at this place and the type of data
39 * \author Benjamin Legros
40 * \author Nevrax France
43 class CColumn
: public CPDSLogger
50 _MetaType(PDS_UnknownMetaType
),
51 _DataType(PDS_UnknownDataType
),
52 _TypeId(INVALID_TYPE_ID
),
53 //_ReferencedAttribute(0),
68 bool init(CAttribute
* parent
, CDatabase
*root
);
71 bool initialised() const { return _Init
; }
73 /// Get meta type of column
74 TMetaType
getMetaType() const { return _MetaType
; }
76 /// Get data type of column
77 TDataType
getDataType() const { return _DataType
; }
79 /// Get Class descriptor
80 TTypeId
getTypeId() const { return _TypeId
; }
82 /// Get C++ descriptor
83 //uint32 getReferencedAttribute() const { return _ReferencedAttribute; }
86 uint32
getId() const { return _Id
; }
88 /// Get Column byte size
89 uint32
getByteSize() const { return _ByteSize
; }
92 uint32
getByteOffset() const { return _ByteOffset
; }
95 const std::string
& getName() const { return _Name
; }
97 /// Get parent attribute
98 const CAttribute
* getParent() const { return _Parent
; }
101 const CDatabase
* getRoot() const { return _Root
; }
105 void setByteOffset(uint32 offset
) { _ByteOffset
= offset
; }
109 void warning(const std::string &msg) const;
112 void debug(const std::string &msg) const;
117 virtual std::string
getLoggerIdentifier() const { return NLMISC::toString("col:%s", (_Name
.empty() ? "<unnamed>" : _Name
.c_str())); }
131 /// Name of the column
134 /// Id of column in row
138 /// Metatype of column, can only be PDS_Type, PDS_BackRef, PDS_ForwardRef, PDS_Set
141 /// Data type of attribute
144 /// Type descriptor of the column
148 /// Back/Forward referenced attribute in the parent class
149 //uint32 _ReferencedAttribute;
152 /// Column size in byte
155 /// Byte offset from row start
159 friend class CAttribute
;
164 #endif // NL_PDS_COLUMN_H
166 /* End of pds_column.h */