Sen API
Sen Libraries
Loading...
Searching...
No Matches
sen::db Namespace Reference

Namespaces

namespace  python
namespace  test

Classes

class  Annotation
 Represents an annotation which can be added to a recording. More...
class  Creation
 Represents the creation of an object. More...
class  Cursor
 A cursor that can be used to iterate over the contents of a recording. The cursor holds a payload which can have one of the values given as type arguments. More...
class  Deletion
 Represents the deletion of an object. More...
class  End
 Represents the end of the recording. Used in cursors. More...
class  Event
 Represents the emission of an event by some object. More...
class  Input
 Allows you to access an existing recording in the file system. More...
class  Keyframe
 Represents the state of the system at a given time. The state of the system is made of the snapshots of all the objects present at the time of the snapshot. More...
struct  KeyframeIndex
 The location of a keyframe in an archive. More...
struct  ObjectIndexDef
 Describes an object that has been indexed. More...
struct  ObjectInfo
 Basic information about an object tracked for recording. More...
class  Output
 Allows the creation of recordings. More...
class  PropertyChange
 Represents the change of a property value. More...
struct  RecordingMergeDuplicateObject
 Conflict data passed to the duplicate object resolver. More...
struct  RecordingMergeInput
 Recording input used by the merger. More...
struct  RecordingMergeKeepSelectedObject
 Object that we need to keep and discards the other in a duplicate conflict. More...
class  RecordingMergeObject
 Information about an object found while merging recordings. More...
struct  RecordingMergeObjectRename
 New name selected for one object in a duplicate object conflict. More...
struct  RecordingMergeRenameObjects
 Resolution that assigns new names to objects in a duplicate conflict. More...
struct  RecordingMergeSettings
 Settings used to merge several recording archives into one archive. More...
class  Snapshot
 Represents the full state of an object at a point in time. More...

Typedefs

using DataCursor = Cursor<End, PropertyChange, Event, Keyframe, Creation, Deletion>
 A cursor that can iterate over data entries.
using AnnotationCursor = Cursor<End, Annotation>
 A cursor that can iterate over annotation entries.
using ErrorHandler = std::function<void()>
 A function to be called in case of error.
using ObjectInfoList = std::vector<ObjectInfo>
 A list of information elements about tracked objects.
using RecordingMergeDuplicateObjectResolution
 Decision returned by the duplicate object resolver.
using RecordingMergeDuplicateObjectResolver
 Callback used to resolve duplicate object names.
using RecordingMergeProgressReporter = std::function<void(std::size_t bytesDone, std::size_t bytesTotal)>
 Reports merge progress. Both values are in bytes of input, and the reporter is called only when the whole-percent figure changes, so it is safe to do visible work in it.

Enumerations

enum class  RecordingMergeMode { RecordingMergeMode::normalMerge , RecordingMergeMode::zeroAligned , RecordingMergeMode::offsetAligned }
 Timestamp alignment modes supported when merging recording archives. More...

Functions

void mergeRecordings (const RecordingMergeSettings &settings)
 Merges recording archives into a single archive.
std::shared_ptr< spdlog::logger > getLogger ()
uint32_t getFileHeaderSize ()
template<typename T, typename B>
void writeToBuffer (const T &data, B &buffer)
template<typename T>
void write (T &&data, FILE *file)
template<typename T>
std::shared_ptr< ResizableHeapBlock > writeSizeAndDataToBuffer (const T &data)
void writeToCompressedBuffer (const std::vector< uint8_t > &memBuf, kernel::Buffer &lz4Buf)
void uncompressBuffer (const std::vector< uint8_t > &lz4Buf, std::vector< uint8_t > &memBuf, std::size_t decompressedSize)
FILE * openFile (const std::filesystem::path &path)
const ::sen::ClassType * searchOwner (const ::sen::ClassType *classType, const ::sen::Property *property) noexcept
 Returns the class in the hierarchy of classes that owns the property. Returns nullptr if not found.
const ::sen::ClassType * searchOwner (const ::sen::ClassType *classType, const ::sen::Event *event) noexcept
 Returns the class in the hierarchy of classes to which the event is mapped. Returns nullptr if not found.
MemberHash computePlatformDependentPropertyId (const ::sen::ClassType *classType, const ::sen::Property *property)
 Computes the old version (platform-dependent) of the property id. Used for retro-compatibility.
MemberHash computePlatformDependentEventId (const ::sen::ClassType *classType, const ::sen::Event *event)
 Computes the old version (platform-dependent) of the event id. Used for retro-compatibility.
void doWrite (const Span< const uint8_t > &span, FILE *file)

Variables

constexpr uint32_t keyframeIndexId = 0U
constexpr uint32_t beginMagic = 0xcafebabeU
constexpr std::string_view runtimeFileName = "runtime"
constexpr std::string_view typesFileName = "types"
constexpr std::string_view indexesFileName = "indexes"
constexpr std::string_view annotationsFileName = "annotations"
constexpr std::string_view summaryFileName = "summary"

Function Documentation

◆ mergeRecordings()

void sen::db::mergeRecordings ( const RecordingMergeSettings & settings)

Merges recording archives into a single archive.

Parameters
settingsInput archives, output archive, alignment mode, and duplicate resolution callback.

◆ getLogger()

std::shared_ptr< spdlog::logger > sen::db::getLogger ( )

◆ getFileHeaderSize()

uint32_t sen::db::getFileHeaderSize ( )
inlinenodiscard

◆ writeToBuffer()

template<typename T, typename B>
void sen::db::writeToBuffer ( const T & data,
B & buffer )
inline

◆ write()

template<typename T>
void sen::db::write ( T && data,
FILE * file )
inline

◆ writeSizeAndDataToBuffer()

template<typename T>
std::shared_ptr< ResizableHeapBlock > sen::db::writeSizeAndDataToBuffer ( const T & data)
inlinenodiscard

◆ writeToCompressedBuffer()

void sen::db::writeToCompressedBuffer ( const std::vector< uint8_t > & memBuf,
kernel::Buffer & lz4Buf )

◆ uncompressBuffer()

void sen::db::uncompressBuffer ( const std::vector< uint8_t > & lz4Buf,
std::vector< uint8_t > & memBuf,
std::size_t decompressedSize )

◆ openFile()

FILE * sen::db::openFile ( const std::filesystem::path & path)
nodiscard

◆ searchOwner() [1/2]

const ::sen::ClassType * sen::db::searchOwner ( const ::sen::ClassType * classType,
const ::sen::Property * property )
nodiscardnoexcept

Returns the class in the hierarchy of classes that owns the property. Returns nullptr if not found.

◆ searchOwner() [2/2]

const ::sen::ClassType * sen::db::searchOwner ( const ::sen::ClassType * classType,
const ::sen::Event * event )
nodiscardnoexcept

Returns the class in the hierarchy of classes to which the event is mapped. Returns nullptr if not found.

◆ computePlatformDependentPropertyId()

MemberHash sen::db::computePlatformDependentPropertyId ( const ::sen::ClassType * classType,
const ::sen::Property * property )
nodiscard

Computes the old version (platform-dependent) of the property id. Used for retro-compatibility.

◆ computePlatformDependentEventId()

MemberHash sen::db::computePlatformDependentEventId ( const ::sen::ClassType * classType,
const ::sen::Event * event )
nodiscard

Computes the old version (platform-dependent) of the event id. Used for retro-compatibility.

◆ doWrite()

void sen::db::doWrite ( const Span< const uint8_t > & span,
FILE * file )

Variable Documentation

◆ keyframeIndexId

uint32_t sen::db::keyframeIndexId = 0U
constexpr

◆ beginMagic

uint32_t sen::db::beginMagic = 0xcafebabeU
constexpr

◆ runtimeFileName

std::string_view sen::db::runtimeFileName = "runtime"
constexpr

◆ typesFileName

std::string_view sen::db::typesFileName = "types"
constexpr

◆ indexesFileName

std::string_view sen::db::indexesFileName = "indexes"
constexpr

◆ annotationsFileName

std::string_view sen::db::annotationsFileName = "annotations"
constexpr

◆ summaryFileName

std::string_view sen::db::summaryFileName = "summary"
constexpr