dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx_common.h File Reference
#include "dx_macros.h"
#include "dx_exception.h"
#include "dx_redirect.h"
#include "dx_log.h"
#include <regex>
#include <string>
#include <map>
#include <shared_mutex>
Include dependency graph for dx_common.h:
This graph shows which files directly or indirectly include this file:

Classes

class  dx::abstract::event
 the counting event every scope implements: a signal raises the count, a wait takes one (or resets the count where the waiter serves them all at once) More...
struct  dx::aggregate<types>
 forwards a braced argument list into a type with no matching constructor - the conversion builds it from the stored tuple, so an aggregate can be returned or passed where its own members would not deduce More...
class  dx::event<user>
 the process local event over a condition variable; dx::event<kernel> is the platform's own, waitable together with an OS handle More...
class  dx::launch<object_t>
 RAII object launcher. More...
class  dx::listen<listener_t>
 guarded listerners map used from the server side to manage listeners More...
class  dx::listener<listen_t>
 balanced listener client into servers listeners map used from the client side to manage its subscription into the server listeners map More...
class  dx::listeners<listener_t>
 internal helper to map single listener into listerners map More...
class  dx::object
 the framework's object lifecycle: launch() once mounted, conclude() before removal, both reached through the try_ pair alone, which elects the single caller that runs them. Neither is a constructor's or destructor's job: an object is constructed long before its resources exist (a device ahead of its bus arrival) and outlives their release. The destructor's try_conclude() is the backstop for an object never concluded by its owner. More...
class  dx::open<object_t>
 RAII manage balanced object open/(close). More...
class  dx::reference<object_t>
 RAII manage balanced object open/(close). More...
class  dx::shared::guard<object_t>
 synchronize write/shared read access/destruction More...
class  dx::string
 a fixed size name that crosses a process or kernel boundary by value, where a std::string cannot: the platform's file name length, always terminated, converting to and from std::string More...
class  dx::trace::indent::receipt
 a dx::trace::receipt indenting everything logged inside its scope by one level - what $ expands to More...
class  dx::trace::receipt
 the $ trace's entry and exit lines for one scope, the exit carrying the time spent - debug builds alone More...
struct  dx::void_struct
 the empty stand-in where a template needs a type but nothing is carried - it streams nothing More...

Namespaces

namespace  dx
 dynax driver framework interface namespace
namespace  dx::abstract
namespace  dx::fourchar
 the four character codes of the OS audio APIs: to::string prints the printable bytes and the numeric value of the others, from::string packs four bytes back into the word
namespace  dx::fourchar::from
namespace  dx::fourchar::to
namespace  dx::shared
namespace  dx::thread
 thread
namespace  dx::trace
namespace  dx::trace::indent

Macros

#define class   dx::trace::indent::receipt at_dynax_trace_receipt(dx::trace::pretty(__PRETTY_FUNCTION__), __FUNCTION__);

Functions

template<typename... types>
 dx::aggregate(types &&...) -> aggregate<types &&...>
std::string dx::canonical(const std::string& name, size_t length= DX_FILENAME_LENGTH)
 remove invalid characters from file name or return a hex hash if name is too long
template<typename ... next_t>
os_result dx::map_os_result(os_result result, os_result desired, next_t... next)
 map list of os_results to a desired value This helper allows to ignore a list of os_results and if matched return the desired result instead.
std::string dx::thread::name()
std::ostream& dx::operator <<(std::ostream& os, const log& log)
std::ostream& dx::operator <<(std::ostream& os, const log::level& level)
std::ostream& dx::operator <<(std::ostream& os, const log::pipe& pipe)
std::ostream& dx::operator <<(std::ostream& os, const log::scope& scopescope)
std::ostream& dx::operator <<(std::ostream& os, const void_struct &)
std::ostream& operator <<(std::ostream& os, const dx::string& string)
template<size_t size>
std::ostream& operator <<(std::ostream& os, const uint8_t(& data)[size])
 a byte array as a hex dump with its ASCII column, 16 bytes a line, 32 past 256 bytes - every raw descriptor and message in the logs reads this way
template<typename type_t, typename... types_t>
type_t& dx::static_try(const types_t&... args)
 a function local static whose constructor may throw: the throw is reported and a default constructed object takes its place, so the caller always gets one and the construction is attempted once
template<typename type_t, typename... types_t>
type_t& dx::static_try(types_t&... args)
uint32_t dx::fourchar::from::string(const char* fourchar)
std::string dx::fourchar::to::string(uint32_t fourchar)
const std::string& dx::to_string(const std::string& string)
std::string dx::version(uint32_t v32, bool full= false)
 a DX_VERSION32 word as it is read: major.minor.sub with the deployment letter and the build number behind it

Macro Definition Documentation

◆ class

#define class   dx::trace::indent::receipt at_dynax_trace_receipt(dx::trace::pretty(__PRETTY_FUNCTION__), __FUNCTION__);

Function Documentation

◆ operator <<() [1/2]

std::ostream& operator <<(std::ostream& os, const dx::string& string)
inline

◆ operator <<() [2/2]

template<size_t size>
std::ostream& operator <<(std::ostream& os, const uint8_t(&) data[size])
inline

a byte array as a hex dump with its ASCII column, 16 bytes a line, 32 past 256 bytes - every raw descriptor and message in the logs reads this way