51Degrees Common C/C++  4.1

A shared functionality library that is used by 51Degrees products

MetaData.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_METADATA_HPP
17 #define FIFTYONE_DEGREES_METADATA_HPP
18 
19 #include "Collection.hpp"
20 #include "ComponentMetaData.hpp"
21 #include "PropertyMetaData.hpp"
22 #include "ProfileMetaData.hpp"
23 #include "ValueMetaData.hpp"
24 #include "resource.h"
25 #include <memory>
26 
27 namespace FiftyoneDegrees {
28  namespace Common {
61  class MetaData {
62  public:
74  MetaData(shared_ptr<fiftyoneDegreesResourceManager> manager);
75 
79  virtual ~MetaData();
80 
93 
100 
107 
114 
129  getValuesForProperty(PropertyMetaData *property) = 0;
130 
139  getValuesForProfile(ProfileMetaData *profile) = 0;
140 
147  ProfileMetaData *profile) = 0;
148 
155  PropertyMetaData *property) = 0;
156 
164  ComponentMetaData *component) = 0;
165 
174  PropertyMetaData *property) = 0;
175 
186 
193  ValueMetaData *value) = 0;
194 
198  protected:
205  shared_ptr<fiftyoneDegreesResourceManager> manager;
206 
215  string getString(
216  fiftyoneDegreesCollection *strings,
217  uint32_t offset);
218  };
219  }
220 }
221 
222 #endif
virtual Collection< byte, ComponentMetaData > * getComponents()=0
Get a new Collection instance of all component meta data keyed on the unique id of the component.
virtual Collection< ValueMetaDataKey, ValueMetaData > * getValuesForProfile(ProfileMetaData *profile)=0
Get a new Collection instance of value meta data for the specified profile, keyed on the name of the ...
MetaData(shared_ptr< fiftyoneDegreesResourceManager > manager)
Construct a new instance of MetaData.
Definition: MetaData.cpp:22
virtual Collection< string, PropertyMetaData > * getProperties()=0
Get a new Collection instance of all property meta data keyed on the name of the property.
51Degrees base namespace.
Definition: Collection.hpp:24
virtual ComponentMetaData * getComponentForProperty(PropertyMetaData *property)=0
Get the Component which the specified property relates to.
virtual ~MetaData()
Free any data and handles used for the meta data.
Definition: MetaData.cpp:26
virtual ProfileMetaData * getDefaultProfileForComponent(ComponentMetaData *component)=0
Get the default profile for the specified component.
shared_ptr< fiftyoneDegreesResourceManager > manager
A shared pointer to the manager is passed around and referenced by all instances that hold open a res...
Definition: MetaData.hpp:205
EntityMetaData relating to a component populated by an engine implementation.
Definition: ComponentMetaData.hpp:30
virtual Collection< uint32_t, ProfileMetaData > * getProfiles()=0
Get a new Collection instance of all profile meta data keyed on the unique id of the profile.
Meta data relating to a property populated by an engine implementation.
Definition: PropertyMetaData.hpp:31
Meta data relating to a value populated by an engine implementation.
Definition: ValueMetaData.hpp:110
Contains meta data for the properties, values, profiles and components that exist within the engine i...
Definition: MetaData.hpp:61
virtual PropertyMetaData * getPropertyForValue(ValueMetaData *value)=0
Get the property which the value relates to.
virtual Collection< ValueMetaDataKey, ValueMetaData > * getValuesForProperty(PropertyMetaData *property)=0
Get a new Collection instance of value meta data relating to the specified property,...
virtual Collection< string, PropertyMetaData > * getPropertiesForComponent(ComponentMetaData *component)=0
Get a new Collection instance of the property meta data relating to the specified component,...
A group of items accessible by index or key.
Definition: Collection.hpp:72
virtual ValueMetaData * getDefaultValueForProperty(PropertyMetaData *property)=0
Get the default value for the specified component.
virtual Collection< ValueMetaDataKey, ValueMetaData > * getValues()=0
Get a new Collection instance of all value meta data keyed on the name of the value and the property ...
Meta data relating to a profile populated by an engine implementation.
Definition: ProfileMetaData.hpp:30
All the shared methods and fields required by file, memory and cached collections.
Definition: collection.h:400
virtual ComponentMetaData * getComponentForProfile(ProfileMetaData *profile)=0
Get the Component which the specified profile relates to.
string getString(fiftyoneDegreesCollection *strings, uint32_t offset)
Get a string from the collection and copy it to a C++ string instance.
Definition: MetaData.cpp:29