Skip to main content
LibUserd is the primary interface to the USERD library. All interaction starts at this object. One object instance exists in a process. Inherits from:
  • ILibUserd

Members

Private static attributes

Variable s_libuserd

Type: LibUserd *

Variable s_active_reader

Type: Reader *

Private attributes

Variable m_reader_extensions

Type: std::vector< fileExtensions >

Friends

Friend ReaderInfo

Public static functions

Function library_interface

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 Return type: LibUserd *

Function get_active_reader

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. Return type: Reader *

Public functions

Function set_reader_path

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:
  • const: std::string & path
Returns: ErrorCode returns IGNORED_AFTER_INITIALIZE if called after initialize() Parameters:
  • const std::string & path
Return type: ErrorCode

Function set_message_handler

set_message_handler Many readers can output diagnostic information. This function allows an application to intercept and handle that type of information. Parameters:
  • ErrorProc: The called supplied function to be called when output is generated
  • void: * userdata A user supplied pointer that is passed to the function.
Returns: ErrorCode Parameters:
  • ErrorProc
  • void * userdata
Return type: ErrorCode

Function initialize

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. ?> 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 Parameters:
  • int32_t number_of_ranks = 0
Return type: ErrorCode

Function get_available_reader_count

get_available_reader_count Return a count of the readers that are available. Returns: size_t Number of available readers Return type: size_t

Function get_all_readers

get_all_readers Return a list of the readers that are available. Parameters:
  • std::vector<ReaderInfo>: & info
Returns: ErrorCode Parameters:
  • std::vector< IReaderInfo * > & info
Return type: ErrorCode

Function query_format

query_format For a given dataset (filename(s)), ask the readers if they should be able to read that data. Parameters:
  • const: std::string & name1 Primary input filename
  • const: std::string & name2 Optional, secondary input filename
  • std::vector<ReaderInfo>: & reader_info a list of readers that might be able to read the dataset
Returns: ErrorCode Parameters:
  • const std::string & name1
  • const std::string & name2
  • std::vector< IReaderInfo * > & reader_info
Return type: ErrorCode

Function shutdown

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 Return type: ErrorCode

Private functions

Function LibUserd

Return type:

Function LibUserd

Parameters:
  • const LibUserd &
Return type:

Function initReaderExtensions

Return type: void

Function processFilename

Parameters:
  • const std::string & filename
Return type: std::string

Private static functions

Function set_active_reader

Parameters: Return type: void