API 4.4.1-2022-10-19-2c4045e59
For MATLAB, Python, Java, and C++ users
|
DataAdapter is an abstract class defining an interface for reading/writing in/out the contents of a DataTable. More...
Public Member Functions | |
virtual DataAdapter * | clone () const =0 |
DataAdapter ()=default | |
DataAdapter (const DataAdapter &)=default | |
DataAdapter (DataAdapter &&)=default | |
DataAdapter & | operator= (const DataAdapter &)=default |
DataAdapter & | operator= (DataAdapter &&)=default |
virtual | ~DataAdapter ()=default |
DataAdapter::OutputTables | read (const std::string &dataSourceSpecification) const |
Public interface to read data from a dataSourceSpecification, typically a file or folder. More... | |
const std::shared_ptr< AbstractDataTable > | getDataTable (const OutputTables &tables, const std::string tableName) |
Generic interface to retrieve a specific table by name from read result. More... | |
Static Public Member Functions | |
static bool | registerDataAdapter (const std::string &identifier, const DataAdapter &adapter) |
Register a concrete DataAdapter by its unique string identifier. More... | |
DataAdapter is an abstract class defining an interface for reading/writing in/out the contents of a DataTable.
It enables access to/from various data sources/sinks such as: streams, files, databases and devices. The DataTable is independent of the form and format of the data in/out of the source/sink. Concrete classes handle the details (e.g. format, sequential access, etc...) associated with a particular data source/sink. The base DataAdapter contains a static registry to serve as a factory for concrete DataAdpaters, given a string identifier of the type of adapter. The adapter knows the source format and data flow (read, write, both). String identifiers can be associated with file formats according to known file extensions.
|
default |
|
default |
|
default |
|
virtualdefault |
typedef std::map<std::string, const AbstractDataTable*> OpenSim::DataAdapter::InputTables |
Collection of tables accepted by writing methods implemented in derived classes.
typedef std::map<std::string, std::shared_ptr<AbstractDataTable> > OpenSim::DataAdapter::OutputTables |
Collection of tables returned by reading methods implemented in derived classes.
typedef std::map<std::string, std::shared_ptr<DataAdapter> > OpenSim::DataAdapter::RegisteredDataAdapters |
Type of the registry containing registered adapters.
|
pure virtual |
|
staticprotected |
Creator of concrete DataAdapter(s) for the specified source type by its unique identifier (string).
For example, for file based sources, a component can acquire the necessary adapter instance to read the data by the file extension if the extension is used as its identifier.
|
protectedpure virtual |
Implements reading functionality.
Implemented in OpenSim::APDMDataReader, OpenSim::DelimFileAdapter< T >, OpenSim::DelimFileAdapter< double >, OpenSim::TRCFileAdapter, and OpenSim::XsensDataReader.
|
protectedpure virtual |
Implements writing functionality.
Implemented in OpenSim::APDMDataReader, OpenSim::XsensDataReader, OpenSim::DelimFileAdapter< T >, OpenSim::DelimFileAdapter< double >, and OpenSim::TRCFileAdapter.
|
inline |
Generic interface to retrieve a specific table by name from read result.
|
default |
|
default |
|
inline |
Public interface to read data from a dataSourceSpecification, typically a file or folder.
|
static |
Register a concrete DataAdapter by its unique string identifier.
Registration permits access to the required concrete adapter by identifier lookup. As such, identifiers must be unique, but adapters may be registered with multiple identifiers. For example, a data file may have multiple valid extensions (e.g. ".jpg: and ".jpeg") in which case both extensions would be valid identifiers for the same adapter. If an identifier is already in use an Exception is thrown. All OpenSim data adapters are automatically registered at start of the program.