0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
RecoveredServers.h
Go to the documentation of this file.
1 /*
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 
26 
27 #ifndef Hypertable_Master_RecoveredServers_h
28 #define Hypertable_Master_RecoveredServers_h
29 
31 
32 #include <set>
33 #include <string>
34 
35 namespace Hypertable {
36 
39 
45  public:
46 
50 
56 
58  virtual ~RecoveredServers() { }
59 
62  void add(const std::string &location);
63 
68  bool contains(const std::string &location);
69 
70  private:
71 
74  uint8_t encoding_version() const override;
75 
79  size_t encoded_length_internal() const override;
80 
83  void encode_internal(uint8_t **bufp) const override;
84 
91  void decode_internal(uint8_t version, const uint8_t **bufp,
92  size_t *remainp) override;
93 
95  void decode(const uint8_t **bufp, size_t *remainp,
96  uint16_t definition_version) override;
97 
100  const std::string name() override;
101 
104  void display(std::ostream &os) override;
105 
107  std::set<std::string> m_servers;
108 
109  };
110 
112  typedef std::shared_ptr<RecoveredServers> RecoveredServersPtr;
113 
115 
116 }
117 
118 #endif // Hypertable_Master_RecoveredServers_h
void encode_internal(uint8_t **bufp) const override
Writes serialized representation of object to a buffer.
void decode(const uint8_t **bufp, size_t *remainp, uint16_t definition_version) override
MetaLog entity decode method.
std::set< std::string > m_servers
Set of proxy names of recovered servers.
EntityHeader header
Entity header
uint8_t encoding_version() const override
Returns encoding version.
Base class for MetaLog entities.
Definition: MetaLogEntity.h:62
bool contains(const std::string &location)
Check to see if proxy name is in recovered servers set.
Declarations for MetaLog::Entity.
std::shared_ptr< RecoveredServers > RecoveredServersPtr
Smart pointer to RecoveredServers.
Set of recovered servers.
Hypertable definitions
size_t encoded_length_internal() const override
Returns internal serialized length.
const std::string name() override
Returns the name of the entity (RecoveredServers).
void display(std::ostream &os) override
Writes a textual representation of the entity to an output stream.
virtual ~RecoveredServers()
Destructor.
void add(const std::string &location)
Adds proxy name to recovered servers set.
RecoveredServers()
Default constructor.
void decode_internal(uint8_t version, const uint8_t **bufp, size_t *remainp) override
Reads serialized representation of object from a buffer.