Config

Static configuration of the libstored library.

stored::DefaultConfig

struct DefaultConfig

Default configuration.

All configuration options are set at compile-time.

To override defaults, copy the file stored_config.h to your own project, set the configuration values properly, and make sure that that file is in the include path before the libstored one.

Subclassed by stored::Config

Public Static Attributes

static bool const AvoidDynamicMemory = false

When true, avoid dynamic memory reallocation where possible.

The Allocator will still be used, but reallocation to dynamically sized buffers is avoided. This implies that worst-case allocation may be done at startup.

static bool const CompressStreams = true

When true, all streams (including) trace are compressed using stored::CompressLayer.

static bool const Debug = true

When true, compile as debug binary.

This may include additional (and possibly slow) code for debugging, which can safely left out for release builds.

static int const DebuggerAlias = 0x100

When not 0, stored::Debugger implements the alias capability.

The defined number is the number of aliases that are supported at the same time.

static bool const DebuggerEcho = true

When true, stored::Debugger implements the echo capability.

static bool const DebuggerIdentification = true

When true, stored::Debugger implements the identification capability.

static bool const DebuggerList = true

When true, stored::Debugger implements the list capability.

static bool const DebuggerListPrefixAlways = false

When true, stored::Debugger always lists the store prefix, even if there is only one store mapped.

static int const DebuggerMacro = 0x1000

When not 0, stored::Debugger implements the macro capability.

The defined number is the total amount of memory that can be used for all macro definitions (excluding data structure overhead of the implementation).

static bool const DebuggerRead = true

When true, stored::Debugger implements the read capability.

static bool const DebuggerReadMem = false

When true, stored::Debugger implements the read memory capability.

static size_t const DebuggerStreamBuffer = 1024

Size of one stream buffer in bytes.

static size_t const DebuggerStreamBufferOverflow = 0

The maximum (expected) size the stream buffer may overflow.

The trace uses a stream buffer. As long the buffer contents are below DebuggerStreamBuffer, another sample may be added. This may make the buffer overflow, resulting in a dynamic reallocation. To avoid realloc, a trace sample (after compression) should fit in DebuggerStreamBufferOverflow, which is a preallocated space on top of DebuggerStreamBuffer. As the trace sample size is application- dependent, this should be set appropriately. When set to small, realloc will happen anyway.

static int const DebuggerStreams = 2

When not 0, stored::Debugger implements the streams capability.

The defined number is the number of concurrent streams that are supported.

static bool const DebuggerTrace = DebuggerStreams > 0 && DebuggerMacro > 0

When true, stored::Debugger implements the trace capability.

static int const DebuggerVersion = 2

When true, stored::Debugger implements the version capability.

static bool const DebuggerWrite = true

When true, stored::Debugger implements the write capability.

static bool const DebuggerWriteMem = false

When true, stored::Debugger implements the write memory capability.

static bool const EnableAssert = Debug

When true, enable stored_assert() checks.

static bool const EnableHooks = true

When true, enable calls to hook…() functions of the store.

This may be required for additional synchronization, but may add overhead for every object access.

static bool const FullNames = true

When true, include full name directory listing support.

If false, a listing can be still be requested, but the names may be abbreviated.

static bool const StoreInLittleEndian = false

Indicate if the store’s buffer is in little endian.

Usually, you would use the same endianness as the host, but as the Synchronizer does not swap endianness for the data, synchronization between different CPU types is not possible. In that case, one on both sides should save its store differently.

Make sure that this flag corresponds to the endianness setting of the generator (-b flag).

static bool const UnalignedAccess = true

Allow unaligned memory access.

template<typename T>
struct Allocator

Allocator to be used for all dynamic memory allocations.

Define a similar struct with type member to override the default allocator.

C++11’s template <typename T> using Allocator = std::allocator<T>; would be nicer, but this construct works for all versions of C++.

Public Types

typedef std::allocator<T> type

stored::Config

struct Config : public stored::DefaultConfig

Example of a configuration that override the stored::DefaultConfig.

See also

stored_config.h