File burster.hpp

namespace o80
class Burster
#include <burster.hpp>

Class managing the bursting mode of BackEnd and Standalone. Expected usage:

Burster burster(segment_id);
while(true) {
    std::cout << "iterate!" << std::endl;
    burster.pulse()
}
The code above will wait until the method “burst” of a related FrontEnd is called, which triggers one iteration to occur.

Public Functions

Burster(std::string segment_id)
~Burster()
bool pulse()

Public Static Functions

static void clear_memory(std::string segment_id)

If an instance of Burster has not been cleanly exited (i.e. destructor not called), wipe the related shared memory (hanging at startup may otherwise occuring)

static void turn_on(std::string segment_id)

Turn on the bursting mode of the burster, i.e. it will iterate only when receiving a signal from the frontend.

static void turn_off(std::string segment_id)

Disable the bursting mode, i.e. the pulse method will always return immediately.

Private Functions

long int get_nb_bursts() const
void reset_nb_bursts()
bool should_run() const

Private Members

std::string segment_id_
long int nb_bursts_
long int nb_iterated_
bool running_
std::shared_ptr<synchronizer::Follower> follower_
class BursterClient
#include <burster.hpp>

Client of Burster, i.e. used for commanding an instance of Burster of the same segment_id to perform a serie of pulses. Used internally by Frontend’s instances.

Public Types

typedef std::shared_ptr<synchronizer::Leader> LeaderPtr

Public Functions

BursterClient(std::string segment_id)
void burst(int nb_iterations)
void final_burst()

Private Functions

void set_bursting(int nb_iterations)

Private Members

synchronizer::Leader leader_
std::string segment_id_