51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

EntityMetaData.hpp

1 /* *********************************************************************
2  * This Source Code Form is copyright of 51 Degrees Mobile Experts Limited.
3  * Copyright 2019 51 Degrees Mobile Experts Limited, 5 Charlotte Close,
4  * Caversham, Reading, Berkshire, United Kingdom RG4 7BY
5  *
6  * This Source Code Form is subject to the terms of the Mozilla Public
7  * License, v. 2.0.
8  *
9  * If a copy of the MPL was not distributed with this file, You can obtain
10  * one at http://mozilla.org/MPL/2.0/.
11  *
12  * This Source Code Form is "Incompatible With Secondary Licenses", as
13  * defined by the Mozilla Public License, v. 2.0.
14  * ********************************************************************* */
15 
16 #ifndef FIFTYONE_DEGREES_ENTITY_META_DATA_HPP
17 #define FIFTYONE_DEGREES_ENTITY_META_DATA_HPP
18 
19 #include <string>
20 #include <vector>
21 #include "data.h"
22 
23 using namespace std;
24 
25 namespace FiftyoneDegrees {
26  namespace Common {
38  template <class K> class EntityMetaData {
39  public:
50 
55  EntityMetaData(K key) { this->key = key; }
56 
67  K getKey() { return key; }
68 
80  const bool operator== (const EntityMetaData<K> other) const {
81  return other.key == key;
82  }
83 
90  const bool operator!= (const EntityMetaData<K> other) const {
91  return !(other.key == key);
92  }
93 
97  private:
99  K key;
100  };
101  }
102 }
103 
104 #endif
K getKey()
Get the unique key for this entity instance.
Definition: EntityMetaData.hpp:67
51Degrees base namespace.
Definition: Collection.hpp:24
Base class for any entity meta data.
Definition: EntityMetaData.hpp:38
EntityMetaData(K key)
Construct a new instance with the key provided.
Definition: EntityMetaData.hpp:55
EntityMetaData()
Default constructor, should not be used externally as it produces an invalid instance.
Definition: EntityMetaData.hpp:49