libfoedus-core
FOEDUS Core Library
sequential_metadata.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2015, Hewlett-Packard Development Company, LP.
3  * This program is free software; you can redistribute it and/or modify it
4  * under the terms of the GNU General Public License as published by the Free
5  * Software Foundation; either version 2 of the License, or (at your option)
6  * any later version.
7  *
8  * This program is distributed in the hope that it will be useful, but WITHOUT
9  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11  * more details. You should have received a copy of the GNU General Public
12  * License along with this program; if not, write to the Free Software
13  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14  *
15  * HP designates this particular file as subject to the "Classpath" exception
16  * as provided by HP in the LICENSE.txt file that accompanied this code.
17  */
18 #ifndef FOEDUS_STORAGE_SEQUENTIAL_SEQUENTIAL_METADATA_HPP_
19 #define FOEDUS_STORAGE_SEQUENTIAL_SEQUENTIAL_METADATA_HPP_
20 #include <stdint.h>
21 
22 #include <iosfwd>
23 #include <string>
24 
25 #include "foedus/cxx11.hpp"
26 #include "foedus/error_stack.hpp"
32 
33 namespace foedus {
34 namespace storage {
35 namespace sequential {
55  : Metadata(0, kSequentialStorage, ""), truncate_epoch_(Epoch::kEpochInvalid), padding_(0) {}
57  : Metadata(id, kSequentialStorage, name), truncate_epoch_(Epoch::kEpochInvalid), padding_(0) {
58  }
60  explicit SequentialMetadata(const StorageName& name)
61  : Metadata(0, kSequentialStorage, name), truncate_epoch_(Epoch::kEpochInvalid), padding_(0) {
62  }
63 
64  std::string describe() const;
65  friend std::ostream& operator<<(std::ostream& o, const SequentialMetadata& v);
66 
67  uint32_t unused_dummy_func_padding() const { return padding_; }
68 
76 
77  uint32_t padding_;
78 };
79 
83  : MetadataSerializer(data), data_casted_(data) {}
86 };
87 
88 } // namespace sequential
89 } // namespace storage
90 } // namespace foedus
91 #endif // FOEDUS_STORAGE_SEQUENTIAL_SEQUENTIAL_METADATA_HPP_
friend std::ostream & operator<<(std::ostream &o, const SequentialMetadata &v)
Definitions of IDs in this package and a few related constant values.
uint32_t StorageId
Unique ID for storage.
Definition: storage_id.hpp:55
Root package of FOEDUS (Fast Optimistic Engine for Data Unification Services).
Definition: assert_nd.hpp:44
uint32_t EpochInteger
Unsigned integer representation of epoch.
Definition: epoch.hpp:64
#define EXTERNALIZABLE(clazz)
Macro to declare/define essential methods for an externalizable class.
Represents a time epoch.
Definition: epoch.hpp:61
Metadata of one storage.
Definition: metadata.hpp:58
Forward declarations of classes in sequential storage package.
#define CXX11_FINAL
Used in public headers in place of "final" of C++11.
Definition: cxx11.hpp:131
Epoch::EpochInteger truncate_epoch_
The min epoch value (truncate-epoch) for all valid records in this storage.
Definitions of IDs in this package and a few related constant values.
SequentialMetadata(StorageId id, const StorageName &name)
SequentialMetadata(const StorageName &name)
This one is for newly creating a storage.