TDME2 1.9.121
Enum.h
Go to the documentation of this file.
1#pragma once
2
3#include <string>
4
5#include <tdme/tdme.h>
7
8using std::string;
9
10/**
11 * Enum base class
12 * @author Andreas Drewke
13 */
15private:
16 string name;
17 int32_t ordinal;
18
19public:
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};
Enum base class.
Definition: Enum.h:14
int32_t getOrdinal() const
Definition: Enum.h:37
const string & getName() const
Definition: Enum.h:30
int32_t ordinal
Definition: Enum.h:17
Enum(const string &name, int32_t ordinal)
Public constructor.
Definition: Enum.cpp:6
bool equals(Enum *enumObject) const
Compare enum with another enum.
Definition: Enum.h:45