Skip to content

class eCAL::eh5::HDF5Meas

eCAL HDF5 measurement API

Members

public HDF5Meas()

Constructor.

public explicit HDF5Meas(const std::string & path,eAccessType access)

Constructor.

Parameters

  • path Input file path / measurement directory path (see meas directory structure description bellow, in Open method).

  • access Access type

public ~HDF5Meas()

Destructor.

public HDF5Meas(const HDF5Meas & other) = delete

Copy constructor deleted.

public HDF5Meas&operator=(const HDF5Meas & other) = delete

Move assignemnt deleted.

public HDF5Meas(HDF5Meas &&) = default

Move constructor.

public HDF5Meas&operator=(HDF5Meas &&) = default

Move assignment.

public bool Open(const std::string & path,eAccessType access)

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)

    1
    File path as input (eAccessType::RDONLY):
    2
    - root directory (e.g.: M:\measurement_directory\measurement01) in this case all hosts subdirectories will be iterated,
    3
    - host directory (e.g.: M:\measurement_directory\measurement01\CARPC01),
    4
    - file path, path to file from measurement (e.g.: M:\measurement_directory\measurement01\CARPC01\meas01_05.hdf5).
    5
    6
    File path as output (eAccessType::CREATE):
    7
    - full path to measurement directory (recommended with host name) (e.g.: M:\measurement_directory\measurement01\CARPC01),
    8
    - 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.

public bool Close()

Close file.

Returns

true if succeeds, false if it fails

public bool IsOk() const

Checks if file/measurement is ok.

Returns

true if meas can be opened(read) or location is accessible(write), false otherwise

public std::string GetFileVersion() const

Get the File Type Version of the current opened file.

Returns

file version

public size_t GetMaxSizePerFile() const

Gets maximum allowed size for an individual file.

Returns

maximum size in MB

public void SetMaxSizePerFile(size_t size)

Sets maximum allowed size for an individual file.

Parameters

  • size maximum size in MB

public 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

public 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

public std::set< std::string > GetChannelNames() const

Get the available channel names of the current opened file / measurement.

Returns

channel names

public bool HasChannel(const std::string & channel_name) const

Check if channel exists in measurement.

Parameters

  • channel_name name of the channel

Returns

true if exists, false otherwise

public std::string GetChannelDescription(const std::string & channel_name) const

Get the channel description for the given channel.

Parameters

  • channel_name channel name

Returns

channel description

public void SetChannelDescription(const std::string & channel_name,const std::string & description)

Set description of the given channel.

Parameters

  • channel_name channel name

  • description description of the channel

public std::string GetChannelType(const std::string & channel_name) const

Gets the channel type of the given channel.

Parameters

  • channel_name channel name

Returns

channel type

public void SetChannelType(const std::string & channel_name,const std::string & type)

Set type of the given channel.

Parameters

  • channel_name channel name

  • type type of the channel

public long long GetMinTimestamp(const std::string & channel_name) const

Gets minimum timestamp for specified channel.

Parameters

  • channel_name channel name

Returns

minimum timestamp value

public long long GetMaxTimestamp(const std::string & channel_name) const

Gets maximum timestamp for specified channel.

Parameters

  • channel_name channel name

Returns

maximum timestamp value

public bool GetEntriesInfo(const std::string & channel_name,EntryInfoSet & entries) const

Gets the header info for all data entries for the given channel Header = timestamp + entry id.

Parameters

  • channel_name channel name

  • entries header info for all data entries

Returns

true if succeeds, false if it fails

public bool GetEntriesInfoRange(const std::string & channel_name,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_name channel name

  • begin time range begin timestamp

  • end time range end timestamp

  • entries header info for data entries in given range

Returns

true if succeeds, false if it fails

public bool GetEntryDataSize(long long entry_id,size_t & size) const

Gets data size of a specific entry.

Parameters

  • entry_id Entry ID

  • size Entry data size

Returns

true if succeeds, false if it fails

public bool GetEntryData(long long entry_id,void * data) const

Gets data from a specific entry.

Parameters

  • entry_id Entry ID

  • data Entry data

Returns

true if succeeds, false if it fails

public 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.

public bool AddEntryToFile(const void * data,const unsigned long long & size,const long long & snd_timestamp,const long long & rcv_timestamp,const std::string & channel_name,long long id,long long clock)

Add entry to file.

Parameters

  • data data to be added

  • size size of the data

  • snd_timestamp send time stamp

  • rcv_timestamp receive time stamp

  • channel_name channel name

  • id message id

  • clock message clock

Returns

true if succeeds, false if it fails

public void ConnectPreSplitCallback(CallbackFunction cb)

Connect callback for pre file split notification.

Parameters

  • cb callback function

public void DisconnectPreSplitCallback()

Disconnect pre file split callback.

typedef CallbackFunction

Callback function type for pre file split notification.