casacore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Adios2StMan.h
Go to the documentation of this file.
1 //# Adios2StMan.h: Base class of the ADIOS2 Storage Manager
2 //# Copyright (C) 2018
3 //# Associated Universities, Inc. Washington DC, USA.
4 //#
5 //# This library is free software; you can redistribute it and/or modify it
6 //# under the terms of the GNU Library General Public License as published by
7 //# the Free Software Foundation; either version 2 of the License, or (at your
8 //# option) any later version.
9 //#
10 //# This library is distributed in the hope that it will be useful, but WITHOUT
11 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13 //# License for more details.
14 //#
15 //# You should have received a copy of the GNU Library General Public License
16 //# along with this library; if not, write to the Free Software Foundation,
17 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18 //#
19 //# Correspondence concerning AIPS++ should be addressed as follows:
20 //# Internet email: aips2-request@nrao.edu.
21 //# Postal address: AIPS++ Project Office
22 //# National Radio Astronomy Observatory
23 //# 520 Edgemont Road
24 //# Charlottesville, VA 22903-2475 USA
25 //#
26 //# $Id$
27 
28 #ifndef ADIOS2STMAN_H
29 #define ADIOS2STMAN_H
30 
31 #include <map>
32 #include <memory>
33 #include <string>
34 #include <vector>
35 
36 #include <mpi.h>
37 
41 
42 namespace casacore
43 {
44 
45 class Adios2StMan : public DataManager
46 {
47  friend class Adios2StManColumn;
48  template<typename T> friend class Adios2StManColumnT;
49 public:
50 
51  Adios2StMan(MPI_Comm mpiComm = MPI_COMM_WORLD,
52  std::string engineType = std::string(),
53  std::map<std::string, std::string> engineParams
54  = std::map<std::string, std::string>(),
55  std::vector<std::map<std::string, std::string>> transportParams
56  = std::vector<std::map<std::string, std::string>>(),
57  std::vector<std::map<std::string, std::string>> operatorParams
58  = std::vector<std::map<std::string, std::string>>());
59 
60  Adios2StMan(std::string xmlFile, MPI_Comm mpiComm = MPI_COMM_WORLD);
61 
62  virtual ~Adios2StMan();
63 
64  virtual DataManager *clone() const;
65  virtual String dataManagerType() const;
66  virtual String dataManagerName() const;
67  virtual void create64(rownr_t aNrRows);
68  virtual rownr_t open64(rownr_t aRowNr, AipsIO &ios);
69  virtual rownr_t resync64(rownr_t aRowNr);
70  virtual Bool flush(AipsIO &, Bool doFsync);
71  virtual DataManagerColumn *makeScalarColumn(const String &aName,
72  int aDataType,
73  const String &aDataTypeID);
74  virtual DataManagerColumn *makeDirArrColumn(const String &aName,
75  int aDataType,
76  const String &aDataTypeID);
77  virtual DataManagerColumn *makeIndArrColumn(const String &aName,
78  int aDataType,
79  const String &aDataTypeID);
80  virtual void deleteManager();
81  virtual void addRow64(rownr_t aNrRows);
82  static DataManager *makeObject(const String &aDataManType,
83  const Record &spec);
84  Record dataManagerSpec() const;
86 
87 private:
88  class impl;
89  std::unique_ptr<impl> pimpl;
90 }; // end of class Adios2StMan
91 
92 extern "C" void register_adios2stman();
93 } // end of namespace casa
94 
95 #endif
void register_adios2stman()
virtual void deleteManager()
The data manager will be deleted (because all its columns are requested to be deleted).
virtual DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create an indirect array column.
AipsIO is the object persistency mechanism of Casacore.
Definition: AipsIO.h:168
Abstract base class for a column in a data manager.
static DataManager * makeObject(const String &aDataManType, const Record &spec)
virtual Bool flush(AipsIO &, Bool doFsync)
Flush and optionally fsync the data.
virtual DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a direct array column.
virtual void addRow64(rownr_t aNrRows)
Add rows to all columns.
virtual String dataManagerType() const
Return the type name of the data manager (in fact its class name).
Record dataManagerSpec() const
Return a record containing data manager specifications.
virtual String dataManagerName() const
Return the name of the data manager.
A hierarchical collection of named fields of various types.
Definition: Record.h:180
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
virtual DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a column in the data manager on behalf of a table column.
uInt64 rownr_t
Define the type of a row number in a table.
Definition: aipsxtype.h:46
virtual DataManager * clone() const
Make a clone of the derived object.
virtual rownr_t open64(rownr_t aRowNr, AipsIO &ios)
Let the data manager initialize itself for an existing table.
Abstract base class for a data manager.
Definition: DataManager.h:220
std::unique_ptr< impl > pimpl
Definition: Adios2StMan.h:88
virtual void create64(rownr_t aNrRows)
Let the data manager initialize itself for a new table.
String: the storage and methods of handling collections of characters.
Definition: String.h:225
Adios2StMan(MPI_Comm mpiComm=MPI_COMM_WORLD, std::string engineType=std::string(), std::map< std::string, std::string > engineParams=std::map< std::string, std::string >(), std::vector< std::map< std::string, std::string >> transportParams=std::vector< std::map< std::string, std::string >>(), std::vector< std::map< std::string, std::string >> operatorParams=std::vector< std::map< std::string, std::string >>())
virtual rownr_t resync64(rownr_t aRowNr)
Resync the data by rereading cached data from the file.