Class HDF5Meas#
- Defined in File eh5_meas_api_v3.h 
Class Documentation#
- 
class HDF5Meas#
- eCAL HDF5 measurement API - Public Types - 
typedef std::function<void(void)> CallbackFunction#
- Callback function type for pre file split notification. 
 - Public Functions - 
HDF5Meas()#
- Constructor. 
 - 
explicit HDF5Meas(const std::string &path, v3::eAccessType access = v3::eAccessType::RDONLY)#
- Constructor. - Parameters:
- path – Input file path / measurement directory path (see meas directory structure description bellow, in Open method). 
- access – Access type 
 
 
 - 
~HDF5Meas()#
- Destructor. 
 - 
bool Open(const std::string &path, v3::eAccessType access = v3::eAccessType::RDONLY)#
- Open file. - Parameters:
- path – Input file path / measurement directory path. - Default measurement directory structure: - root directory e.g.: M:\measurement_directory\measurement01 - documents directory: |_doc - hosts directories: |_Host1 (e.g.: CARPC01) |_Host2 (e.g.: CARPC02) File path as input (eAccessType::RDONLY): - root directory (e.g.: M:\measurement_directory\measurement01) in this case all hosts subdirectories will be iterated, - host directory (e.g.: M:\measurement_directory\measurement01\CARPC01), - file path, path to file from measurement (e.g.: M:\measurement_directory\measurement01\CARPC01\meas01_05.hdf5). File path as output (eAccessType::CREATE): - full path to measurement directory (recommended with host name) (e.g.: M:\measurement_directory\measurement01\CARPC01), - to set the name of the actual hdf5 file use SetFileBaseName method. 
- access – Access type 
 
- Returns:
- true if output (eAccessType::CREATE) measurement directory structure can be accessed/created, false otherwise. true if input (eAccessType::RDONLY) measurement/file path was opened, false otherwise. 
 
 - 
bool Close()#
- Close file. - Returns:
- true if succeeds, false if it fails 
 
 - 
bool IsOk() const#
- Checks if file/measurement is ok. - Returns:
- true if meas can be opened(read) or location is accessible(write), false otherwise 
 
 - 
std::string GetFileVersion() const#
- Get the File Type Version of the current opened file. - Returns:
- file version 
 
 - 
size_t GetMaxSizePerFile() const#
- Gets maximum allowed size for an individual file. - Returns:
- maximum size in MB 
 
 - 
void SetMaxSizePerFile(size_t size)#
- Sets maximum allowed size for an individual file. - Parameters:
- size – maximum size in MB 
 
 - 
bool IsOneFilePerChannelEnabled() const#
- Whether each Channel shall be writte in its own file. - When enabled, data is clustered by channel and each channel is written to its own file. The filenames will consist of the basename and the channel name. - Returns:
- true, if one file per channel is enabled 
 
 - 
void SetOneFilePerChannelEnabled(bool enabled)#
- Enable / disable the creation of one individual file per channel. - When enabled, data is clustered by channel and each channel is written to its own file. The filenames will consist of the basename and the channel name. - Parameters:
- enabled – Whether one file shall be created per channel 
 
 - 
std::set<SChannel> GetChannels() const#
- Get the available channel names of the current opened file / measurement. - Returns:
- Channels (channel name & id) 
 
 - 
bool HasChannel(const eCAL::eh5::SChannel &channel) const#
- Check if channel exists in measurement. - Parameters:
- channel – channel name & id 
- Returns:
- true if exists, false otherwise 
 
 - 
DataTypeInformation GetChannelDataTypeInformation(const SChannel &channel) const#
- Get data type information of the given channel. - Parameters:
- channel_name – channel name 
- Returns:
- channel type 
 
 - 
void SetChannelDataTypeInformation(const SChannel &channel, const DataTypeInformation &info)#
- Set data type information of the given channel. - Parameters:
- channel_name – channel name 
- info – datatype info of the channel 
 
- Returns:
- channel type 
 
 - 
long long GetMinTimestamp(const SChannel &channel) const#
- Gets minimum timestamp for specified channel. - Parameters:
- channel – channel (name & id) 
- Returns:
- minimum timestamp value 
 
 - 
long long GetMaxTimestamp(const SChannel &channel) const#
- Gets maximum timestamp for specified channel. - Parameters:
- channel – channel (name & id) 
- Returns:
- maximum timestamp value 
 
 - 
bool GetEntriesInfo(const SChannel &channel, EntryInfoSet &entries) const#
- Gets the header info for all data entries for the given channel Header = timestamp + entry id. - Parameters:
- channel – [in] channel (name & id) 
- entries – [out] header info for all data entries 
 
- Returns:
- true if succeeds, false if it fails 
 
 - 
bool GetEntriesInfoRange(const SChannel &channel, long long begin, long long end, EntryInfoSet &entries) const#
- Gets the header info for data entries for the given channel included in given time range (begin->end) Header = timestamp + entry id. - Parameters:
- channel – [in] channel (name & id) 
- begin – [in] time range begin timestamp 
- end – [in] time range end timestamp 
- entries – [out] header info for data entries in given range 
 
- Returns:
- true if succeeds, false if it fails 
 
 - 
bool GetEntryDataSize(long long entry_id, size_t &size) const#
- Gets data size of a specific entry. - Parameters:
- entry_id – [in] Entry ID 
- size – [out] Entry data size 
 
- Returns:
- true if succeeds, false if it fails 
 
 - 
bool GetEntryData(long long entry_id, void *data) const#
- Gets data from a specific entry. - Parameters:
- entry_id – [in] Entry ID 
- data – [out] Entry data 
 
- Returns:
- true if succeeds, false if it fails 
 
 - 
void SetFileBaseName(const std::string &base_name)#
- Set measurement file base name (desired name for the actual hdf5 files that will be created) - Parameters:
- base_name – Name of the hdf5 files that will be created. 
 
 - 
bool AddEntryToFile(const SWriteEntry &entry)#
- Add entry to file. - Parameters:
- entry – the entry to be added to the file 
- Returns:
- true if succeeds, false if it fails 
 
 - 
void ConnectPreSplitCallback(CallbackFunction cb)#
- Connect callback for pre file split notification. - Parameters:
- cb – callback function 
 
 - 
void DisconnectPreSplitCallback()#
- Disconnect pre file split callback. 
 
- 
typedef std::function<void(void)> CallbackFunction#