Classes | |
struct | ValVectorIndexingSuite |
Struct containing wrapper functions for list-like indexing of ValVector<uint32_t> in python. More... | |
Enumerations | |
enum | LogLevel { DEBUG , INFO , NOTICE , WARNING , ERROR , FATAL } |
Log level enum - switch to using enums for setting log-levels in python. More... | |
Functions | |
void | setLogLevelTo (const pycohal::LogLevel &logLevel) |
Wrapper function for uhal::setLogLevelTo - converts pycohal::LogLevel enum values to C++ uhal log-level classes. More... | |
const bool & | LoggingIncludes (const pycohal::LogLevel &logLevel) |
Wrapper function for uhal::LoggingIncludes - converts pycohal::LogLevel enum values to C++ uhal log-level classes. More... | |
void | wrap_enums (pybind11::module_ &) |
void | wrap_logging_functions (pybind11::module_ &) |
void | wrap_exceptions (pybind11::module_ &) |
Wraps all uHAL exceptions (i.e. creates corresponding Python classes, and regsiters appropriate exception translators) More... | |
uint32_t | defs_NOMASK () |
template<class T > | |
std::vector< T > | copy_vector (const std::vector< T > &aVec) |
Trivial function that returns copy of vector argument in order to test vector to/from list converters. [Function solely used in unit-tests]. More... | |
template<class T > | |
std::vector< T > | convert_string_to_vector (const std::string &aString) |
Returns vector, generated from splitting string argument using "," as delimeter, and converting string to type via lexical cast. [Function solely used in unit-tests]. More... | |
template<> | |
std::vector< std::string > | convert_string_to_vector (const std::string &aString) |
bool | test_check_uint32_argument (uint32_t aUInt, const py::bytes &uIntString) |
Returns whether uint32 and string arguments represent the same nubmer. Used in tests to check that uint32 arguments don't get altered at python-to-C boundary. More... | |
uint32_t | test_convert_str_to_uint32 (const std::string &uIntString) |
Converts string argument to uint32_t, and returns this value. Used in tests to check that uint32 return values don't get altered at C-to-python boundary. More... | |
uhal::ValWord< uint32_t > | get_dummy_ValWord (const uint32_t aValue, const bool aValid) |
Returns dummy ValWord instance for testing. More... | |
void | create_sigbus_buard () |
void | wrap_test_functions (py::module_ &aModule) |
Wraps functions that are only sed in unti tests. Puts them in "tests" sub-module. More... | |
std::shared_ptr< uhal::ClientInterface > | buildClient (const std::string &aId, const std::string &aURI) |
Constructs a ClientInterface using the ClientFactory. More... | |
py::bytes | hex_string (const uhal::ValWord< uint32_t > &valWord) |
Returns hex string for ValWord<uint32_t> value. More... | |
std::string | convert_to_string (const uhal::ValWord< uint32_t > &valWord) |
std::string | convert_to_string (const uhal::ValVector< uint32_t > &valVec) |
Variables | |
const auto | const_ref_return_policy = py::return_value_policy::copy |
Default return value policy for const references returned attribute 'getter' methods. More... | |
const auto | norm_ref_return_policy = py::return_value_policy::reference_internal |
Return value policy for internal references. More... | |
enum pycohal::LogLevel |
Log level enum - switch to using enums for setting log-levels in python.
Enumerator | |
---|---|
DEBUG | |
INFO | |
NOTICE | |
WARNING | |
ERROR | |
FATAL |
Definition at line 12 of file enums_logging.hpp.
std::shared_ptr< uhal::ClientInterface > pycohal::buildClient | ( | const std::string & | aId, |
const std::string & | aURI | ||
) |
Constructs a ClientInterface using the ClientFactory.
Definition at line 139 of file cactus_pycohal.cpp.
References uhal::ClientFactory::getClient(), and uhal::ClientFactory::getInstance().
Referenced by PYBIND11_MODULE().
std::vector< T > pycohal::convert_string_to_vector | ( | const std::string & | aString | ) |
Returns vector, generated from splitting string argument using "," as delimeter, and converting string to type via lexical cast. [Function solely used in unit-tests].
Definition at line 46 of file cactus_pycohal.cpp.
std::vector< std::string > pycohal::convert_string_to_vector | ( | const std::string & | aString | ) |
Definition at line 66 of file cactus_pycohal.cpp.
std::string pycohal::convert_to_string | ( | const uhal::ValVector< uint32_t > & | valVec | ) |
Definition at line 190 of file cactus_pycohal.cpp.
References uhal::ValVector< T >::at(), and uhal::ValVector< T >::size().
std::string pycohal::convert_to_string | ( | const uhal::ValWord< uint32_t > & | valWord | ) |
Definition at line 185 of file cactus_pycohal.cpp.
References uhal::ValWord< T >::value().
Referenced by PYBIND11_MODULE().
std::vector< T > pycohal::copy_vector | ( | const std::vector< T > & | aVec | ) |
Trivial function that returns copy of vector argument in order to test vector to/from list converters. [Function solely used in unit-tests].
Definition at line 39 of file cactus_pycohal.cpp.
void pycohal::create_sigbus_buard | ( | ) |
Definition at line 105 of file cactus_pycohal.cpp.
Referenced by wrap_test_functions().
uint32_t pycohal::defs_NOMASK | ( | ) |
Definition at line 32 of file cactus_pycohal.cpp.
References uhal::defs::NOMASK.
Referenced by PYBIND11_MODULE().
uhal::ValWord< uint32_t > pycohal::get_dummy_ValWord | ( | const uint32_t | aValue, |
const bool | aValid | ||
) |
Returns dummy ValWord instance for testing.
Definition at line 96 of file cactus_pycohal.cpp.
References uhal::ValWord< T >::valid(), and uhal::ValWord< T >::value().
Referenced by wrap_test_functions().
py::bytes pycohal::hex_string | ( | const uhal::ValWord< uint32_t > & | valWord | ) |
Returns hex string for ValWord<uint32_t> value.
Definition at line 145 of file cactus_pycohal.cpp.
References uhal::ValWord< T >::value().
Referenced by PYBIND11_MODULE().
const bool & pycohal::LoggingIncludes | ( | const pycohal::LogLevel & | logLevel | ) |
Wrapper function for uhal::LoggingIncludes - converts pycohal::LogLevel enum values to C++ uhal log-level classes.
Definition at line 43 of file enums_logging.cpp.
References uhal::Debug, DEBUG, uhal::Error, ERROR, uhal::Fatal, FATAL, uhal::Info, INFO, uhal::LoggingIncludes(), uhal::Notice, NOTICE, uhal::Warning, and WARNING.
Referenced by wrap_logging_functions().
void pycohal::setLogLevelTo | ( | const pycohal::LogLevel & | logLevel | ) |
Wrapper function for uhal::setLogLevelTo - converts pycohal::LogLevel enum values to C++ uhal log-level classes.
Definition at line 15 of file enums_logging.cpp.
References uhal::Debug, DEBUG, uhal::Error, ERROR, uhal::Fatal, FATAL, uhal::Info, INFO, uhal::Notice, NOTICE, uhal::setLogLevelTo(), uhal::Warning, and WARNING.
Referenced by wrap_logging_functions().
bool pycohal::test_check_uint32_argument | ( | uint32_t | aUInt, |
const py::bytes & | uIntString | ||
) |
Returns whether uint32 and string arguments represent the same nubmer. Used in tests to check that uint32 arguments don't get altered at python-to-C boundary.
Definition at line 82 of file cactus_pycohal.cpp.
Referenced by wrap_test_functions().
uint32_t pycohal::test_convert_str_to_uint32 | ( | const std::string & | uIntString | ) |
Converts string argument to uint32_t, and returns this value. Used in tests to check that uint32 return values don't get altered at C-to-python boundary.
Definition at line 90 of file cactus_pycohal.cpp.
Referenced by wrap_test_functions().
void pycohal::wrap_enums | ( | pybind11::module_ & | aModule | ) |
Definition at line 65 of file enums_logging.cpp.
References DEBUG, ERROR, FATAL, uhal::defs::HIERARCHICAL, uhal::defs::INCREMENTAL, INFO, uhal::defs::NON_INCREMENTAL, NOTICE, uhal::defs::READ, uhal::defs::READWRITE, uhal::defs::SINGLE, WARNING, and uhal::defs::WRITE.
Referenced by PYBIND11_MODULE().
void pycohal::wrap_exceptions | ( | pybind11::module_ & | aModule | ) |
Wraps all uHAL exceptions (i.e. creates corresponding Python classes, and regsiters appropriate exception translators)
Definition at line 17 of file exceptions.cpp.
Referenced by PYBIND11_MODULE().
void pycohal::wrap_logging_functions | ( | pybind11::module_ & | aModule | ) |
Definition at line 88 of file enums_logging.cpp.
References uhal::disableLogging(), LoggingIncludes(), uhal::setLogLevelFromEnvironment(), and setLogLevelTo().
Referenced by PYBIND11_MODULE().
void pycohal::wrap_test_functions | ( | py::module_ & | aModule | ) |
Wraps functions that are only sed in unti tests. Puts them in "tests" sub-module.
Definition at line 111 of file cactus_pycohal.cpp.
References create_sigbus_buard(), get_dummy_ValWord(), uhal::tests::measureFileReadLatency(), uhal::tests::measureFileWriteLatency(), uhal::tests::measureReadLatency(), uhal::tests::measureWriteLatency(), test_check_uint32_argument(), and test_convert_str_to_uint32().
Referenced by PYBIND11_MODULE().
const auto pycohal::const_ref_return_policy = py::return_value_policy::copy |
Default return value policy for const references returned attribute 'getter' methods.
Definition at line 132 of file cactus_pycohal.cpp.
Referenced by PYBIND11_MODULE().
const auto pycohal::norm_ref_return_policy = py::return_value_policy::reference_internal |
Return value policy for internal references.
For member functions, it causes python garbage collector to keep 'self' (i.e. this) alive behind-the-scences as long as the returned object still exists. N.B: This return value policy is a safe option, but not necessarily the most optimal.
Definition at line 136 of file cactus_pycohal.cpp.
Referenced by PYBIND11_MODULE().