opm-common
Loading...
Searching...
No Matches
Opm::TableContainer Class Reference

The TableContainer class implements a simple map: More...

#include <TableContainer.hpp>

Public Types

using TableMap = std::map<size_t, std::shared_ptr<SimpleTable>>

Public Member Functions

 TableContainer (size_t maxTables)
bool empty () const
size_t size () const
size_t max () const
const TableMap & tables () const
void addTable (size_t tableNumber, std::shared_ptr< SimpleTable > table)
bool hasTable (size_t tableNumber) const
const SimpleTablegetTable (size_t tableNumber) const
const SimpleTableoperator[] (size_t tableNumber) const
template<class TableType>
const TableType & getTable (size_t tableNumber) const
bool operator== (const TableContainer &data) const
template<class Serializer>
void serializeOp (Serializer &serializer)

Static Public Member Functions

static TableContainer serializationTestObject ()

Detailed Description

The TableContainer class implements a simple map:

{tableNumber, Table}

The main functionality of the TableContainer class is that the getTable() method implements the ECLIPSE behavior:

If table N is not implemented - use table N - 1.

The getTable() method will eventually throw an exception if not even table 0 is there.

Consider the following code:

TableContainer container(10);

std::shared_ptr<TableType> table0 = std::make_shared<TableType>(...); container.addTable(table0, 0)

We create a container with maximum 10 tables, and then we add one single table at slot 0; then we have:

container.size() == 1 container.hasTable( 0 ) == true container.hasTable( 9 ) == false container.hasTable(10 ) == false

container.getTable( 0 ) == container[9] == table0; container.gteTable(10 ) ==> exception


The documentation for this class was generated from the following files:
  • opm/input/eclipse/EclipseState/Tables/TableContainer.hpp
  • opm/input/eclipse/EclipseState/Tables/TableContainer.cpp