Skip to main content

EnSight 2025 R2

libuserd::LibUserd Class Reference

Last update: 16.07.2025

#include <libuserd_interface.h>

Inheritance diagram for libuserd::LibUserd:

Public Member Functions

ErrorCode set_reader_path (const std::string &path) override
 set_reader_path
 
ErrorCode set_message_handler (ErrorProc, void *userdata) override
 set_message_handler
 
ErrorCode initialize (int32_t number_of_ranks=0) override
 initialize
 
size_t get_available_reader_count () override
 get_available_reader_count
 
ErrorCode get_all_readers (std::vector< IReaderInfo * > &info) override
 get_all_readers
 
ErrorCode query_format (const std::string &name1, const std::string &name2, std::vector< IReaderInfo * > &reader_info) override
 query_format
 
ErrorCode shutdown () override
 shutdown
 

Static Public Member Functions

static LibUserdlibrary_interface ()
 library_interface
 
static Readerget_active_reader ()
 get_active_reader
 

Friends

class ReaderInfo
 

Detailed Description

LibUserd is the primary interface to the USERD library. All interaction starts at this object. One object instance exists in a process.

Definition at line 527 of file libuserd_interface.h.

Member Function Documentation

◆ get_active_reader()

static Reader * libuserd::LibUserd::get_active_reader ( )
static

get_active_reader

Return the currently active reader if any.

Returns
libuserd::Reader* The currently active reader or nullptr if ReaderInfo::read_dataset has not been called.

◆ get_all_readers()

ErrorCode libuserd::LibUserd::get_all_readers ( std::vector< IReaderInfo * > & info)
override

get_all_readers

Return a list of the readers that are available.

Parameters
[out]std::vector<ReaderInfo>& info
Returns
ErrorCode

◆ get_available_reader_count()

size_t libuserd::LibUserd::get_available_reader_count ( )
override

get_available_reader_count

Return a count of the readers that are available.

Returns
size_t Number of available readers

◆ initialize()

ErrorCode libuserd::LibUserd::initialize ( int32_t number_of_ranks = 0)
override

initialize

This call initializes the libuserd system. It causes the library to scan for available readers and set up any required reduction engine bits. It can only be called once.

Note
number_of_ranks is not currently implemented. It is used to specify the number of parallel servers to use to read the dataset. The values 0 and 1 both represent serial data access. Current code should use the value 0.
Returns
ErrorCode

◆ library_interface()

static LibUserd * libuserd::LibUserd::library_interface ( )
static

library_interface

Get the pointer to the library interface.

Note: LibUserd is a singleton and this function will return the existing instance or create a new instance.

Returns
libuserd::LibUserd* The library interface

◆ query_format()

ErrorCode libuserd::LibUserd::query_format ( const std::string & name1,
const std::string & name2,
std::vector< IReaderInfo * > & reader_info )
override

query_format

For a given dataset (filename(s)), ask the readers if they should be able to read that data.

Parameters
[in]conststd::string & name1 Primary input filename
[in]conststd::string & name2 Optional, secondary input filename
[out]std::vector<ReaderInfo>& reader_info a list of readers that might be able to read the dataset
Returns
ErrorCode

◆ set_message_handler()

ErrorCode libuserd::LibUserd::set_message_handler ( ErrorProc ,
void * userdata )
override

set_message_handler

Many readers can output diagnostic information. This function allows an application to intercept and handle that type of information.

Parameters
[in]ErrorProcThe called supplied function to be called when output is generated
[in]void* userdata A user supplied pointer that is passed to the function.
Returns
ErrorCode

◆ set_reader_path()

ErrorCode libuserd::LibUserd::set_reader_path ( const std::string & path)
override

set_reader_path

By default, the library looks for reader shared libraries by looking for Ansys distributions that align with the version number of the libuserd library. A user may override this search path using this function.

Note: This function must be called before initialize() is called and once intialize() has been called, this method will return

Parameters
[in]conststd::string & path
Returns
ErrorCode returns IGNORED_AFTER_INITIALIZE if called after initialize()

◆ shutdown()

ErrorCode libuserd::LibUserd::shutdown ( )
override

shutdown

Shutdown the libuserd library, stopping any active reader and any reduction engine. Once this is called, the LibUserd interface can no longer be used in the current process.

Returns
ErrorCode

Friends And Related Symbol Documentation

◆ ReaderInfo

friend class ReaderInfo
friend

Definition at line 648 of file libuserd_interface.h.


The documentation for this class was generated from the following file:

Connect with Ansys