PIP 5.6.1
Platform-Independent Primitives
Static Public Member Functions | List of all members
PICout::Notifier Class Reference

Class for emit notifications of PICout. More...

#include <picout.h>

Static Public Member Functions

static Notifierinstance ()
 Singleton access to PICout::Notifier Returns the singleton instance of the Notifier class used for emitting PICout events.
 
static PIObjectobject ()
 Object that emit events from PICout Returns the PIObject instance that emits events when PICout with external buffer is destroyed.
 

Detailed Description

Class for emit notifications of PICout.

Synopsis

This class used as PICout events emitter. When PICout constructs with external PIString* buffer and some ID, last copy of this PICout on delete emit event "finished()" on object Notifier::object(). Sample:

class A: public PIObject {
PIOBJECT(A)
public:
A() {}
EVENT_HANDLER2(void, pcf, int, id, PIString *, buff) { piCout << "PICout(" << id << ") finished:" << (*buff); }
};
int main() {
A a;
CONNECTU(PICout::Notifier::object(), finished, &a, pcf);
PIString buffer = "my buff:";
PICout::withExternalBufferAndID(&buffer, my_id) << "int 10 ->" << 10 << ", time ->" << PITime::current();
return 0;
}
// PICout( 1 ) finished: my buff:int 10 -> 10 , time -> PITime(14:07:09:000)
static PIObject * object()
Object that emit events from PICout Returns the PIObject instance that emits events when PICout with ...
Definition: picout.cpp:127
static int registerExternalBufferID()
Returns unique external buffer ID for later use in withExternalBufferAndID()
Definition: picout.cpp:763
static PICout withExternalBufferAndID(PIString *buffer, int id, PIFlags< PICoutManipulators::PICoutControl > controls=PICoutManipulators::DefaultControls)
Construct with external buffer and ID "id". See Notifier for details Creates a PICout instance with e...
Definition: picout.cpp:755
Base class for objects that declare events, event handlers and registered methods.
Definition: piobject.h:56
String class.
Definition: pistring.h:42
static PITime current()
Returns current time.
Definition: pidatetime.cpp:203
#define piCout
Definition: picout.h:36