Class Writer#

Inheritance Relationships#

Base Type#

  • public measurement::base::Writer

Class Documentation#

class Writer : public measurement::base::Writer#

Hdf5 based Writer implementation.

Public Functions

Writer() = default#

Constructor.

inline Writer(const std::string &path)#

Constructor.

inline bool Open(const std::string &path) override#

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 output
                 - 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 (AccessType::CREATE) measurement directory structure can be accessed/created, false otherwise.

inline bool Close() override#

Close file.

Returns

true if succeeds, false if it fails

inline bool IsOk() const override#

Checks if file/measurement is ok.

Returns

true if location is accessible, false otherwise

inline size_t GetMaxSizePerFile() const override#

Gets maximum allowed size for an individual file.

Returns

maximum size in MB

inline void SetMaxSizePerFile(size_t size) override#

Sets maximum allowed size for an individual file.

Parameters

size – maximum size in MB

inline bool IsOneFilePerChannelEnabled() const override#

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

inline void SetOneFilePerChannelEnabled(bool enabled) override#

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

inline void SetChannelDescription(const std::string &channel_name, const std::string &description) override#

Set description of the given channel.

Parameters
  • channel_name – channel name

  • description – description of the channel

inline void SetChannelType(const std::string &channel_name, const std::string &type) override#

Set type of the given channel.

Parameters
  • channel_name – channel name

  • type – type of the channel

inline void SetFileBaseName(const std::string &base_name) override#

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.

inline 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) override#

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