0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
PseudoTables.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 
28 #ifndef Hypertable_Lib_PseudoTables_h
29 #define Hypertable_Lib_PseudoTables_h
30 
31 #include "Schema.h"
32 
33 #include <mutex>
34 
35 namespace Hypertable {
36 
43  class PseudoTables {
44 
45  public:
46 
56  };
57 
64  static PseudoTables *instance() {
65  std::lock_guard<std::mutex> lock(ms_mutex);
66 
67  if (!ms_instance)
68  ms_instance = new PseudoTables();
69 
70  return ms_instance;
71  }
72 
75  static void destroy() {
76  std::lock_guard<std::mutex> lock(ms_mutex);
77  if (ms_instance) {
78  delete ms_instance;
79  ms_instance = 0;
80  }
81  }
82 
84 
85  private:
86 
88  PseudoTables();
89 
91  ~PseudoTables();
92 
95 
98  };
99 
101 }
102 
103 #endif // Hypertable_Lib_PseudoTables_h
static std::mutex mutex
Definition: Logger.cc:43
Schema specification.
Definition: Schema.h:52
ColumnFamilyCode
Enumeration for pseudo table column family codes.
Definition: PseudoTables.h:49
.cellstore.index CompressedSize column family
Definition: PseudoTables.h:53
Singleton class holding Schema objects for pseudo tables.
Definition: PseudoTables.h:43
.cellstore.index KeyCount column family
Definition: PseudoTables.h:55
Declarations for Schema.
static void destroy()
Destroys singleton instance of the PseudoTables class.
Definition: PseudoTables.h:75
static PseudoTables * instance()
Creates and/or returns singleton instance of the PseudoTables class.
Definition: PseudoTables.h:64
~PseudoTables()
Destructor (private).
Definition: PseudoTables.cc:65
Hypertable definitions
Schema * cellstore_index
Schema of cellstore.index pseudo table.
Definition: PseudoTables.h:83
.cellstore.index Size column family
Definition: PseudoTables.h:51
PseudoTables()
Constructor (private).
Definition: PseudoTables.cc:61
static std::mutex ms_mutex
Mutex for serializing access to ms_instance.
Definition: PseudoTables.h:97
static PseudoTables * ms_instance
Pointer to singleton instance of this class.
Definition: PseudoTables.h:94