-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEntitySchema.h
More file actions
executable file
·74 lines (59 loc) · 2.19 KB
/
Copy pathEntitySchema.h
File metadata and controls
executable file
·74 lines (59 loc) · 2.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef GLODON_OBJECTBUF_ENTITYSCHEMA_H
#define GLODON_OBJECTBUF_ENTITYSCHEMA_H
#include <vector>
#include <QString>
#include <google/protobuf/io/coded_stream.h>
#include "Entity.h"
#include "glodon/objectbuf/Objectbuf.h"
namespace glodon {
namespace objectbuf {
class EntitySchema: public glodon::objectbuf::Entity
{
public:
EntitySchema(void);
~EntitySchema(void);
int byteSize() const;
bool isInitialized() const;
int typeId() const;
void setName(const QString& sValue)
{
m_sName = sValue;
setHasName();
}
QString getName() const {return m_sName;}
bool hasName() const {return (_has_bits_[0] & 0x1u) != 0;}
void setId(const int& nValue)
{
m_nId = nValue;
setHasId();
}
int getId() const {return m_nId;}
bool hasId() const {return (_has_bits_[0] & 0x2u) != 0;}
int getAttribNamesCount() const {return (int)m_oAttribNames.size();}
void clearAttribNames() {m_oAttribNames.clear();}
void addAttribNames(const QString& sValue) {m_oAttribNames.push_back(sValue);}
QString getAttribNames(int nIndex) const {return m_oAttribNames[nIndex];}
int getAttribIdsCount() const {return (int)m_oAttribIds.size();}
void clearAttribIds() {m_oAttribIds.clear();}
void addAttribIds(const int& nValue) {m_oAttribIds.push_back(nValue);}
int getAttribIds(int nIndex) const {return m_oAttribIds[nIndex];}
void setParent(EntitySchema* pParent) {m_pParent = pParent;}
EntitySchema* getParent() {return m_pParent;}
protected:
virtual void serializeWithCachedSizes(google::protobuf::io::CodedOutputStream* output) const;
virtual google::protobuf::uint8* serializeWithCachedSizesToArray(google::protobuf::uint8* target) const;
virtual EnParseFieldState parseField(google::protobuf::io::CodedInputStream* input, int nFieldNum);
protected:
google::protobuf::uint32 _has_bits_[1];
private:
void setHasName() {_has_bits_[0] |= 0x1u;}
void setHasId() {_has_bits_[0] |= 0x2u;}
QString m_sName;
int m_nId;
std::vector<QString> m_oAttribNames;
std::vector<int> m_oAttribIds;
EntitySchema* m_pParent;
};
}
}
#endif