libpniio
column_info.hpp
Go to the documentation of this file.
1 //
2 // (c) Copyright 2011 DESY, Eugen Wintersberger <eugen.wintersberger@desy.de>
3 //
4 // This file is part of libpniio.
5 //
6 // libpniio 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 // libpniio 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 libpniio. If not, see <http://www.gnu.org/licenses/>.
18 // ===========================================================================
19 //
20 // Created on: Apr 30, 2012
21 // Author: Eugen Wintersberger <eugen.wintersberger@desy.de>
22 //
23 //
24 
25 #pragma once
26 
27 
28 #include <pni/core/types.hpp>
29 #include <vector>
30 
31 namespace pni{
32 namespace io{
33 
44  {
45  private:
46  pni::core::string _name;
47  pni::core::type_id_t _tid;
48  std::vector<size_t> _shape;
49  public:
50  //====================constructors and destructor===================
52  column_info();
53 
54  //-----------------------------------------------------------------
56  column_info(const column_info &ci);
57 
58  //-----------------------------------------------------------------
61 
62  //-----------------------------------------------------------------
75  column_info(const pni::core::string &n,pni::core::type_id_t tid,
76  const std::vector<size_t> &s);
77 
78  //-----------------------------------------------------------------
80  ~column_info();
81 
82  //===================assignment operators==========================
84  column_info &operator=(const column_info &ci);
85 
88 
89  //======================public member methods======================
96  const std::vector<size_t> &shape() const { return _shape;}
97 
98  //-----------------------------------------------------------------
107  pni::core::type_id_t type_id() const { return _tid; }
108 
109  //-----------------------------------------------------------------
116  pni::core::string name() const { return _name; }
117 
118  };
119 
120  std::ostream &operator<<(std::ostream &o,const column_info &ci);
121 
122 
123 //end of namespace
124 }
125 }
126 
std::ostream & operator<<(std::ostream &o, const column_info &ci)
Definition: column_info.cpp:95
column_info & operator=(const column_info &ci)
copy assignment operator
Definition: column_info.cpp:71
pni::core::string _name
name of the columne
Definition: column_info.hpp:46
std::vector< size_t > _shape
shape of column data
Definition: column_info.hpp:48
Definition: cbf_reader.hpp:41
pni::core::string name() const
get name
Definition: column_info.hpp:116
pni::core::type_id_t _tid
type ID of column type
Definition: column_info.hpp:47
~column_info()
destructor
Definition: column_info.cpp:66
column_info()
default constructor
Definition: column_info.cpp:32
const std::vector< size_t > & shape() const
get cell shape
Definition: column_info.hpp:96
Spreadsheet column information.
Definition: column_info.hpp:43
pni::core::type_id_t type_id() const
get cells type ID
Definition: column_info.hpp:107