BusBoy
2
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
cpp
api
metadata
MetadataElement.h
Go to the documentation of this file.
1
17
#ifndef __BUSBOY_METADATA_ELEMENT_H__
18
#define __BUSBOY_METADATA_ELEMENT_H__
19
20
#include <string>
21
22
namespace
BUSBOY {
23
28
class
MetadataElement
{
29
30
public
:
31
enum
Type
{
32
34
FIELD
,
35
37
ARRAY
,
38
40
LIST
,
41
43
MAP
,
44
46
KEY
47
};
48
53
static
Type
enumFromString
(std::string strType);
54
59
static
std::string
enumToString
(
Type
type);
60
61
virtual
Type
getMetadataElementType
()
const
=0;
62
63
virtual
bool
operator==
(
const
MetadataElement
& element)
const
=0;
64
65
virtual
bool
operator!=
(
const
MetadataElement
& element)
const
=0;
66
67
protected
:
68
69
template
<
typename
T>
static
const
T*
castElement
(
const
MetadataElement
* element,
Type
type);
70
71
template
<
typename
T>
static
T*
castElement
(
MetadataElement
* element,
Type
type);
72
73
template
<
typename
T>
static
const
T&
castElement
(
const
MetadataElement
& element,
Type
type);
74
75
template
<
typename
T>
static
T&
castElement
(
MetadataElement
& element,
Type
type);
76
};
77
83
class
CloneableMetadataElement
:
public
MetadataElement
{
84
85
public
:
86
87
virtual
CloneableMetadataElement
*
clone
()
const
=0;
88
89
};
90
91
}
92
#endif
93
Tue Nov 11 2014 23:19:41
1.8.3.1
Copyright 2014 Google Inc. All rights reserved.