Nebula
Toggle main menu visibility
Loading...
Searching...
No Matches
intattrid.h
Go to the documentation of this file.
1
#pragma once
2
//------------------------------------------------------------------------------
12
#include "
attrid.h
"
13
14
//------------------------------------------------------------------------------
15
namespace
Attr
16
{
17
class
IntAttrId
:
public
AttrId
18
{
19
public
:
21
IntAttrId
(
const
AttrId
& rhs);
23
IntAttrId
(
const
AttributeDefinition<IntTypeClass,int>
& rhs);
25
IntAttrId
(
const
Util::String
& rhs);
27
IntAttrId
(
const
Util::FourCC
& rhs);
29
bool
operator==
(
const
IntAttrId
& rhs)
const
;
31
bool
operator!=
(
const
IntAttrId
& rhs)
const
;
32
};
33
34
//------------------------------------------------------------------------------
37
inline
38
IntAttrId::IntAttrId
(
const
AttrId
& rhs) :
39
AttrId
(rhs)
40
{
41
// empty
42
}
43
44
//------------------------------------------------------------------------------
47
inline
48
IntAttrId::IntAttrId
(
const
AttributeDefinition<IntTypeClass,int>
& rhs) :
49
AttrId
(&rhs)
50
{
51
// empty
52
}
53
54
//------------------------------------------------------------------------------
57
inline
58
IntAttrId::IntAttrId
(
const
Util::String
& rhs)
59
{
60
this->
defPtr
=
AttributeDefinitionBase::FindByName
(rhs);
61
n_assert
(this->
GetValueType
() ==
IntType
);
62
}
63
64
//------------------------------------------------------------------------------
67
inline
68
IntAttrId::IntAttrId
(
const
Util::FourCC
& rhs)
69
{
70
this->
defPtr
=
AttributeDefinitionBase::FindByFourCC
(rhs);
71
n_assert
(this->
GetValueType
() ==
IntType
);
72
}
73
74
//------------------------------------------------------------------------------
77
inline
78
bool
79
IntAttrId::operator==
(
const
IntAttrId
& rhs)
const
80
{
81
n_assert
((0 != this->
defPtr
) && (0 != rhs.
defPtr
));
82
return
(this->
defPtr
== rhs.
defPtr
);
83
}
84
85
//------------------------------------------------------------------------------
88
inline
89
bool
90
IntAttrId::operator!=
(
const
IntAttrId
& rhs)
const
91
{
92
n_assert
((0 != this->
defPtr
) && (0 != rhs.
defPtr
));
93
return
(this->
defPtr
!= rhs.
defPtr
);
94
}
95
96
class
Int64AttrId
:
public
AttrId
97
{
98
public
:
100
Int64AttrId
(
const
AttrId
& rhs);
102
Int64AttrId
(
const
AttributeDefinition<Int64TypeClass,int64_t>
& rhs);
104
Int64AttrId
(
const
Util::String
& rhs);
106
Int64AttrId
(
const
Util::FourCC
& rhs);
108
bool
operator==
(
const
Int64AttrId
& rhs)
const
;
110
bool
operator!=
(
const
Int64AttrId
& rhs)
const
;
111
};
112
113
//------------------------------------------------------------------------------
116
inline
117
Int64AttrId::Int64AttrId
(
const
AttrId
& rhs) :
118
AttrId
(rhs)
119
{
120
// empty
121
}
122
123
//------------------------------------------------------------------------------
126
inline
127
Int64AttrId::Int64AttrId
(
const
AttributeDefinition<Int64TypeClass,int64_t>
& rhs) :
128
AttrId
(&rhs)
129
{
130
// empty
131
}
132
133
//------------------------------------------------------------------------------
136
inline
137
Int64AttrId::Int64AttrId
(
const
Util::String
& rhs)
138
{
139
this->
defPtr
=
AttributeDefinitionBase::FindByName
(rhs);
140
n_assert
(this->
GetValueType
() ==
Int64Type
);
141
}
142
143
//------------------------------------------------------------------------------
146
inline
147
Int64AttrId::Int64AttrId
(
const
Util::FourCC
& rhs)
148
{
149
this->
defPtr
=
AttributeDefinitionBase::FindByFourCC
(rhs);
150
n_assert
(this->
GetValueType
() ==
Int64Type
);
151
}
152
153
//------------------------------------------------------------------------------
156
inline
157
bool
158
Int64AttrId::operator==
(
const
Int64AttrId
& rhs)
const
159
{
160
n_assert
((0 != this->
defPtr
) && (0 != rhs.
defPtr
));
161
return
(this->
defPtr
== rhs.
defPtr
);
162
}
163
164
//------------------------------------------------------------------------------
167
inline
168
bool
169
Int64AttrId::operator!=
(
const
Int64AttrId
& rhs)
const
170
{
171
n_assert
((0 != this->
defPtr
) && (0 != rhs.
defPtr
));
172
return
(this->
defPtr
!= rhs.
defPtr
);
173
}
174
175
}
// namespace Attr
176
//------------------------------------------------------------------------------
attrid.h
Attr::AttrId::AttrId
AttrId()
default constructor
Definition
attrid.h:106
Attr::AttrId::GetValueType
ValueType GetValueType() const
get value type
Definition
attrid.h:319
Attr::AttrId::defPtr
const AttributeDefinitionBase * defPtr
Definition
attrid.h:99
Attr::AttributeDefinitionBase::FindByName
static const AttributeDefinitionBase * FindByName(const Util::String &n)
find by name
Definition
attributedefinitionbase.h:166
Attr::AttributeDefinitionBase::FindByFourCC
static const AttributeDefinitionBase * FindByFourCC(const Util::FourCC &fcc)
find by FourCC
Definition
attributedefinitionbase.h:184
Attr::AttributeDefinition
This extends the typeless AttributeDefinitionBase class by a typed template class,...
Definition
attributedefinition.h:20
Attr::Int64AttrId::Int64AttrId
Int64AttrId(const AttrId &rhs)
construct from generic attribute id
Definition
intattrid.h:117
Attr::Int64AttrId::operator!=
bool operator!=(const Int64AttrId &rhs) const
inequality operator
Definition
intattrid.h:169
Attr::Int64AttrId::operator==
bool operator==(const Int64AttrId &rhs) const
equality operator
Definition
intattrid.h:158
Attr::IntAttrId::operator!=
bool operator!=(const IntAttrId &rhs) const
inequality operator
Definition
intattrid.h:90
Attr::IntAttrId::operator==
bool operator==(const IntAttrId &rhs) const
equality operator
Definition
intattrid.h:79
Attr::IntAttrId::IntAttrId
IntAttrId(const AttrId &rhs)
construct from generic attribute id
Definition
intattrid.h:38
Util::FourCC
A four-character-code is a quasi-human-readable 32-bit-id.
Definition
fourcc.h:19
n_assert
#define n_assert(exp)
Definition
debug.h:50
Attr
Definition
accessmode.h:13
Attr::IntType
@ IntType
Definition
valuetype.h:25
Attr::Int64Type
@ Int64Type
Definition
valuetype.h:27
Util.String
Nebula's universal string class.
Definition
String.cs:8
code
addons
attr
intattrid.h
Generated on
for Nebula. Dark theme by
Tilen Majerle
. All rights reserved.