Line data Source code
1 : // Copyright (c) 2019 Made to Order Software Corp. All Rights Reserved
2 : //
3 : // https://snapwebsites.org/project/snapdatabase
4 : // contact@m2osw.com
5 : //
6 : // This program is free software; you can redistribute it and/or modify
7 : // it under the terms of the GNU General Public License as published by
8 : // the Free Software Foundation; either version 2 of the License, or
9 : // (at your option) any later version.
10 : //
11 : // This program 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 along
17 : // with this program; if not, write to the Free Software Foundation, Inc.,
18 : // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 : #pragma once
20 :
21 :
22 : /** \file
23 : * \brief Block representing the schema.
24 : *
25 : * This block is used to represent the schema of the table. If the schema
26 : * is pretty large, multiple blocks can be chained together. The schema
27 : * itself is defined in the schema.cpp/h file.
28 : */
29 :
30 : // self
31 : //
32 : #include "snapdatabase/data/structure.h"
33 :
34 :
35 :
36 :
37 : namespace snapdatabase
38 : {
39 :
40 :
41 :
42 0 : class block_schema
43 : : public block
44 : {
45 : public:
46 : typedef std::shared_ptr<block_schema> pointer_t;
47 :
48 : block_schema(dbfile::pointer_t f, reference_t offset);
49 :
50 : size_t get_structure_size();
51 : uint32_t get_size();
52 : void set_size(uint32_t size);
53 : reference_t get_next_schema_block();
54 : void set_next_schema_block(reference_t offset);
55 :
56 : virtual_buffer::pointer_t get_schema() const;
57 : void set_schema(virtual_buffer::pointer_t schema);
58 :
59 : private:
60 : };
61 :
62 :
63 :
64 : } // namespace snapdatabase
65 : // vim: ts=4 sw=4 et
|