TDME2
1.9.121
src
tdme
utilities
Enum.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
5
#include <
tdme/tdme.h
>
6
#include <
tdme/utilities/fwd-tdme.h
>
7
8
using
std::string;
9
10
/**
11
* Enum base class
12
* @author Andreas Drewke
13
*/
14
class
tdme::utilities::Enum
{
15
private
:
16
string
name
;
17
int32_t
ordinal
;
18
19
public
:
20
/**
21
* Public constructor
22
* @param name name
23
* @param ordinal ordinal or index
24
*/
25
Enum
(
const
string
&
name
, int32_t
ordinal
);
26
27
/**
28
* @return name
29
*/
30
inline
const
string
&
getName
()
const
{
31
return
name
;
32
}
33
34
/**
35
* @return ordinal or index
36
*/
37
inline
int32_t
getOrdinal
()
const
{
38
return
ordinal
;
39
}
40
41
/**
42
* Compare enum with another enum
43
* @return equality
44
*/
45
inline
bool
equals
(
Enum
* enumObject)
const
{
46
return
this
== enumObject;
47
}
48
49
};
tdme::utilities::Enum
Enum base class.
Definition:
Enum.h:14
tdme::utilities::Enum::getOrdinal
int32_t getOrdinal() const
Definition:
Enum.h:37
tdme::utilities::Enum::getName
const string & getName() const
Definition:
Enum.h:30
tdme::utilities::Enum::name
string name
Definition:
Enum.h:16
tdme::utilities::Enum::ordinal
int32_t ordinal
Definition:
Enum.h:17
tdme::utilities::Enum::Enum
Enum(const string &name, int32_t ordinal)
Public constructor.
Definition:
Enum.cpp:6
tdme::utilities::Enum::equals
bool equals(Enum *enumObject) const
Compare enum with another enum.
Definition:
Enum.h:45
tdme.h
fwd-tdme.h
Generated by
1.9.3