C++ API Reference

Detector API

class control

Detector specific

}

void initialize()

Initialize the detector head.

void high_voltage(bool on_off)

Set HV on/off.

bool high_voltage() const

Returns the current HV on/off state.

MPI

int world_rank() const

Return the rank of the control in the world communicator.

Acquisition

void prepare_acq(acq_params_t const &acq_params)

Prepare acquisition.

void start_acq()

Start acquisition.

void soft_trigger()

Software trigger if the camera supports it.

void stop_acq()

Stop acquisition.

void close_acq()

Called when all receivers acquisition has ended.

void reset_acq(reset_level_enum level)

Reset camera.

Progress

int nb_frames_acquired() const

Returns the number of frames acquired.

State

acq_state_enum state() const

Returns the state of the control.

void register_on_state_change(std::function<void(acq_state_enum)> cbk)

Register a callack for a change of state event.

General Info

std::string version() const

Returns the version of the camera plugin.

det_info_t det_info() const

Returns the detector information.

det_capabilities_t det_capabilities() const

Returns hardware capabilities.

det_status_t det_status() const

Returns the status of the detector.

Public Functions

control(init_params_t const &init_params)

Construct the control and broadcast the camera init parameters.

class acquisition

The acquisition class is the high level interface for data acquisition.

MPI

int world_rank() const

Return the rank of the acquisition in the world communicator.

int recv_rank() const

Return the rank of the acquisition in the acquisition communicator.

Acquisition

acq_info_t prepare_acq(acq_params_t const &acq_params)

Prepare acquisition and returns information for the processing.

void start_acq()

Start acquisition.

void stop_acq()

Stop acquisition.

void close_acq()

Called when all receivers acquisition has ended.

void reset_acq()

Reset acquisition.

Progress

int nb_frames_xferred() const

Returns the number of frames transferred.

State

acq_state_enum state() const

Returns the state of the control.

void register_on_state_change(std::function<void(acq_state_enum)> cbk)

Register a callack for on change of state event.

Callbacks

void register_on_start_acq(std::function<void()> cbk)

Register a callack for on start of acquisition event.

void register_on_frame_ready(std::function<void(data_t)> cbk)

Register a callack for on frame ready event.

void register_on_end_acq(std::function<void(int)> cbk)

Register a callack for on end of acquisition event.

Allocators

class numa_resource : public std::pmr::memory_resource

A resource that uses numa_alloc_onnode to allocate memory on a specific numa node.

class cuda_resource : public std::pmr::memory_resource

A resource that uses cudaMallocHost to allocate memory on host.

class um_resource : public std::pmr::memory_resource

A resource that uses AC922_allocate_with_mmap_mbind to allocate memory on Unified Model memory architecture (for Power9)

IO

HDF5

class file : private boost::base_from_member<shared_file_hid_t>, public lima::io::h5::detail::attrs_base<file>, public lima::io::h5::detail::dset_base<file>

Represents an HDF5 file.

Subclassed by lima::io::h5::nx::file

Public Functions

inline bool is_open() const

Returns true if the file is open (aka the hid is valid)

inline group create_group(path const &name, hid_t lcpl_id = H5P_DEFAULT, hid_t gcpl_id = H5P_DEFAULT, hid_t gapl_id = H5P_DEFAULT)

Creates and returns a new group in the file.

inline group require_group(path const &name)

Opens or creates a group in the file.

Public Static Functions

static inline file create(std::filesystem::path const &name, unsigned flags = H5F_ACC_TRUNC, hid_t fcpl_id = H5P_DEFAULT, hid_t fapl_id = H5P_DEFAULT)

Creates a H5 file, flags determines the action if file exists: H5F_ACC_TRUNC: tructate, H5F_ACC_EXCL: raise an exception.

static inline file open(std::filesystem::path const &name, unsigned flags = H5F_ACC_RDONLY, hid_t fapl_id = H5P_DEFAULT)

Opens an existing H5 file, flags determines the access mode: H5F_ACC_RDONLY / H5F_ACC_RDWR.

class group : private boost::base_from_member<shared_group_hid_t>, public lima::io::h5::detail::attrs_base<group>, public lima::io::h5::detail::dset_base<group>

Represents an HDF5 group.

Subclassed by lima::io::h5::nx::group

Public Functions

inline bool is_open() const

Returns true if the group is open (aka the hid is valid)

Public Static Functions

template<typename Location>
static inline group create(Location const &loc, path const &name, hid_t lcpl_id = H5P_DEFAULT, hid_t gcpl_id = H5P_DEFAULT, hid_t gapl_id = H5P_DEFAULT)

Creates a new group and links it into the file.

template<typename Location>
static inline group open(Location const &loc, path const &name, hid_t gapl_id = H5P_DEFAULT)

Opens an existing group.

class dataset : private boost::base_from_member<shared_dataset_hid_t>, public lima::io::h5::detail::attrs_base<dataset>

Represents an HDF5 dataset.

Public Functions

inline bool is_open() const

Returns true if the dataset is open (aka the hid is valid)

inline dataspace space() const

Returns a copy of the dataspace of the dataset.

inline predef_datatype datatype() const

Returns the datatype of the dataset.

inline void write(const void *buffer, predef_datatype dtype, hid_t mem_dspace = H5S_ALL, hid_t file_dspace = H5S_ALL, hid_t dtpl_id = H5P_DEFAULT)

Writes data to the dataset.

inline void write_chunk(const void *buffer, uint32_t filter_mask, hsize_t offset[], size_t data_size, hid_t dtpl_id = H5P_DEFAULT)

Writes chunk to the dataset.

inline void read(void *buffer, predef_datatype dtype, hid_t mem_dspace = H5S_ALL, hid_t file_dspace = H5S_ALL, hid_t dtpl_id = H5P_DEFAULT)

Reads from the dataset.

inline herr_t extent(const hsize_t size[])

Changes the sizes of a dataset’s dimensions.

Creates a soft link to an object (allowed to dangle)