casacore
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 
38 #include <casacore/casa/IO/AipsIO.h>
39 #include <casacore/tables/DataMan/DataManager.h>
40 #include <casacore/tables/Tables/Table.h>
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  Adios2StMan(MPI_Comm mpiComm = MPI_COMM_WORLD);
51  Adios2StMan(MPI_Comm mpiComm, std::string engineType,
52  std::map<std::string, std::string> engineParams,
53  std::vector<std::map<std::string, std::string>> transportParams);
54 
55  virtual ~Adios2StMan();
56 
57  virtual DataManager *clone() const;
58  virtual String dataManagerType() const;
59  virtual String dataManagerName() const;
60  virtual void create(uInt aNrRows);
61  virtual void open(uInt aRowNr, AipsIO &ios);
62  virtual void resync(uInt aRowNr);
63  virtual Bool flush(AipsIO &, Bool doFsync);
64  virtual DataManagerColumn *makeScalarColumn(const String &aName,
65  int aDataType,
66  const String &aDataTypeID);
67  virtual DataManagerColumn *makeDirArrColumn(const String &aName,
68  int aDataType,
69  const String &aDataTypeID);
70  virtual DataManagerColumn *makeIndArrColumn(const String &aName,
71  int aDataType,
72  const String &aDataTypeID);
73  virtual void deleteManager();
74  virtual void addRow(uInt aNrRows);
75  static DataManager *makeObject(const String &aDataManType,
76  const Record &spec);
77  uInt getNrRows();
78 
79 private:
80  class impl;
81  std::unique_ptr<impl> pimpl;
82 }; // end of class Adios2StMan
83 
84 extern "C" void register_adios2stman();
85 } // end of namespace casa
86 
87 #endif
casacore::Adios2StMan::dataManagerName
virtual String dataManagerName() const
Return the name of the data manager.
casacore::Adios2StMan::resync
virtual void resync(uInt aRowNr)
Resync the data by rereading cached data from the file.
casacore::Adios2StMan::makeIndArrColumn
virtual DataManagerColumn * makeIndArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create an indirect array column.
casacore::Adios2StMan::addRow
virtual void addRow(uInt aNrRows)
Add rows to all columns.
casacore::AipsIO
AipsIO is the object persistency mechanism of Casacore
Definition: AipsIO.h:168
casacore::DataManager
Abstract base class for a data manager.
Definition: DataManager.h:224
casacore::Adios2StMan::deleteManager
virtual void deleteManager()
The data manager will be deleted (because all its columns are requested to be deleted).
casacore::Adios2StMan::flush
virtual Bool flush(AipsIO &, Bool doFsync)
Flush and optionally fsync the data.
casacore::Adios2StMan
Definition: Adios2StMan.h:45
casacore::Adios2StMan::makeDirArrColumn
virtual DataManagerColumn * makeDirArrColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a direct array column.
casacore::DataManagerColumn
Abstract base class for a column in a data manager.
Definition: DataManager.h:611
casacore::Adios2StMan::dataManagerType
virtual String dataManagerType() const
Return the type name of the data manager (in fact its class name).
casacore::Adios2StMan::clone
virtual DataManager * clone() const
Make a clone of the derived object.
casacore::Adios2StMan::~Adios2StMan
virtual ~Adios2StMan()
casacore::Adios2StMan::open
virtual void open(uInt aRowNr, AipsIO &ios)
Let the data manager initialize itself for an existing table.
casacore::Adios2StMan::makeObject
static DataManager * makeObject(const String &aDataManType, const Record &spec)
casacore::uInt
unsigned int uInt
Definition: aipstype.h:51
casacore::Adios2StMan::Adios2StMan
Adios2StMan(MPI_Comm mpiComm=MPI_COMM_WORLD)
casacore::Adios2StManColumn
Definition: Adios2StManColumn.h:42
casacore::Adios2StMan::create
virtual void create(uInt aNrRows)
Let the data manager initialize itself for a new table.
casacore
this file contains all the compiler specific defines
Definition: mainpage.dox:28
casacore::Adios2StManColumnT
Definition: Adios2StManColumn.h:167
casacore::Adios2StMan::getNrRows
uInt getNrRows()
casacore::Adios2StMan::makeScalarColumn
virtual DataManagerColumn * makeScalarColumn(const String &aName, int aDataType, const String &aDataTypeID)
Create a column in the data manager on behalf of a table column.
casacore::String
String: the storage and methods of handling collections of characters.
Definition: String.h:223
casacore::Bool
bool Bool
Define the standard types used by Casacore.
Definition: aipstype.h:42
casacore::register_adios2stman
void register_adios2stman()
casacore::Record
A hierarchical collection of named fields of various types.
Definition: Record.h:180
casacore::Adios2StMan::impl
Definition: Adios2StManImpl.h:41
casacore::Adios2StMan::pimpl
std::unique_ptr< impl > pimpl
Definition: Adios2StMan.h:80