Reels
Loading...
Searching...
No Matches
Public Member Functions | List of all members
reels::Clips Class Reference

A container class to hold clips (sequences of events). More...

#include <reels.h>

Inheritance diagram for reels::Clips:
Inheritance graph
[legend]
Collaboration diagram for reels::Clips:
Collaboration graph
[legend]

Public Member Functions

 Clips ()
 Default construct a Clips object as an abstract method. This is required for declaring a Clips object that will later be copy constructed based on conditional statements. More...
 
 Clips (Clients clients, Events events)
 Construct a Clips object from a Clients and an Events objects. More...
 
 Clips (const ClipMap &clip_map)
 Construct a Clips object from a ClipMap to be copied. More...
 
 Clips (Clips &o_clips)
 Copy-construct a Clips object. More...
 
bool scan_event (pChar p_e, pChar p_d, double w, pChar p_c, pChar p_t)
 Process a row from a transaction file, to add the event to the client's timeline (clip). More...
 
void insert_event (ElementHash client_hash, uint64_t code, TimePoint time_pt)
 The kernel of a scan_event() made inline, when all checks and conversion to binary are successful. More...
 
bool load (pBinaryImage &p_bi)
 Load the state of an object from a base64 mercury-dynamics serialization using image_get() More...
 
bool save (pBinaryImage &p_bi)
 Save the state of an object into a base64 mercury-dynamics serialization using image_put() More...
 
pClipMap clip_map ()
 The address of the internal ClipMap to be accessed from a Targets object. More...
 
uint64_t num_events ()
 Return the number of events stored in the internal ClipMap. More...
 
void collapse_to_states ()
 Collapse the ClipMap to states. More...
 
- Public Member Functions inherited from reels::TimeUtil
 TimeUtil ()
 
TimePoint get_time (pChar p_t)
 Convert time as a string to a TimePoint (using the object's time_format). More...
 
void set_time_format (pChar fmt)
 Sets the public property time_format to simplify the python interface. More...
 

Additional Inherited Members

- Public Attributes inherited from reels::TimeUtil
char time_format [128] = "%Y-%m-%d %H:%M:%S"
 Date and time format for insert_row() and define_event() More...
 

Detailed Description

A container class to hold clips (sequences of events).

To simplify the Python interface, the object has a set_time_format() method.

Constructor & Destructor Documentation

◆ Clips() [1/4]

reels::Clips::Clips ( )
inline

Default construct a Clips object as an abstract method. This is required for declaring a Clips object that will later be copy constructed based on conditional statements.

◆ Clips() [2/4]

reels::Clips::Clips ( Clients  clients,
Events  events 
)
inline

Construct a Clips object from a Clients and an Events objects.

Parameters
clientsThe list of all the clients to be processed. If empty, all the clients will be considered.
eventsAn initialized Events object created either by auto-detection (insert_row) or definition (define_event).

◆ Clips() [3/4]

reels::Clips::Clips ( const ClipMap clip_map)
inline

Construct a Clips object from a ClipMap to be copied.

Parameters
clip_mapThe Clips object to be copied.

◆ Clips() [4/4]

reels::Clips::Clips ( Clips o_clips)
inline

Copy-construct a Clips object.

Parameters
o_clipsThe Clips object to be copied.

Member Function Documentation

◆ clip_map()

pClipMap reels::Clips::clip_map ( )
inline

The address of the internal ClipMap to be accessed from a Targets object.

Returns
The address.

◆ collapse_to_states()

void reels::Clips::collapse_to_states ( )
inline

Collapse the ClipMap to states.

This removes identical consecutive codes from all the clips in the ClipMap keeping the time of the first instance.

◆ insert_event()

void reels::Clips::insert_event ( ElementHash  client_hash,
uint64_t  code,
TimePoint  time_pt 
)
inline

The kernel of a scan_event() made inline, when all checks and conversion to binary are successful.

Parameters
client_hashThe "client". Already verified for insertion and converted into hash.
codeThe code number identifying the event already found in events.
time_ptThe "time" already verified and converted into a TimePoint.

◆ load()

bool reels::Clips::load ( pBinaryImage p_bi)

Load the state of an object from a base64 mercury-dynamics serialization using image_get()

Parameters
p_biThe address of a BinaryImage stream containing a previously save()-ed image at the cursor position.
Returns
True on success (Most likely error is a wrong stream).

◆ num_events()

uint64_t reels::Clips::num_events ( )
inline

Return the number of events stored in the internal ClipMap.

Returns
The total count of events aggregating all the clips in the internal ClipMap.

◆ save()

bool reels::Clips::save ( pBinaryImage p_bi)

Save the state of an object into a base64 mercury-dynamics serialization using image_put()

Parameters
p_biThe address of a BinaryImage stream that is either empty or has been used only for writing.
Returns
True on success (Most likely error is allocation).

◆ scan_event()

bool reels::Clips::scan_event ( pChar  p_e,
pChar  p_d,
double  w,
pChar  p_c,
pChar  p_t 
)

Process a row from a transaction file, to add the event to the client's timeline (clip).

Parameters
p_eThe "emitter". A C/Python string representing "owner of event".
p_dThe "description". A C/Python string representing "the event".
wThe "weight". A double representing a weight of the event.
p_cThe "client". A C/Python string representing "the actor".
p_tThe "time". A timestamp of the event as a C/Python string. (The format is given via set_time_format().)
Returns
True on insertion. False usually just means, the event is not in events or the client is not in clients. Occasionally, it may be a time parsing error.

The documentation for this class was generated from the following files: