0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MetaLogDefinition.h
Go to the documentation of this file.
1 /* -*- c++ -*-
2  * Copyright (C) 2007-2015 Hypertable, Inc.
3  *
4  * This file is part of Hypertable.
5  *
6  * Hypertable is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; version 3 of the
9  * License, or any later version.
10  *
11  * Hypertable is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19  * 02110-1301, USA.
20  */
21 
29 #ifndef Hypertable_Lib_MetaLogDefinition_h
30 #define Hypertable_Lib_MetaLogDefinition_h
31 
32 #include "MetaLogEntity.h"
33 
34 #include <Common/String.h>
35 
36 #include <memory>
37 
38 namespace Hypertable {
39 
40  namespace MetaLog {
41 
54  class Definition {
55  public:
56 
61  Definition(const char* backup_label) : m_backup_label(backup_label) { }
62 
66  virtual uint16_t version() = 0;
67 
76  virtual const char *name() = 0;
77 
93  virtual const char *backup_label() { return m_backup_label.c_str(); }
94 
105  virtual EntityPtr create(const EntityHeader &header) = 0;
106 
107  private:
108 
110  std::string m_backup_label;
111  };
112 
114  typedef std::shared_ptr<Definition> DefinitionPtr;
115 
117  }
118 
119 }
120 
121 #endif // Hypertable_Lib_MetaLogDefinition_h
virtual uint16_t version()=0
Returns version number of definition.
Defines the set of valid MetaLog entities for a server.
std::shared_ptr< Entity > EntityPtr
Smart pointer to Entity.
virtual EntityPtr create(const EntityHeader &header)=0
Constructs a MetaLog entity from an entity header.
Declarations for MetaLog::Entity.
virtual const char * name()=0
Returns MetaLog definition name.
Hypertable definitions
std::string m_backup_label
Backup label of MetaLog.
Definition(const char *backup_label)
Constructor.
A String class based on std::string.
virtual const char * backup_label()
Returns backup label of MetaLog.
std::shared_ptr< Definition > DefinitionPtr
Smart pointer to Definition.