class Siena::SimpleSiena

Siena C++ API documentation.

## class SimpleSiena: public virtual Siena

> a simple implementation of the Siena client-side interface

## Inheritance:

### Public Methods

SimpleSiena(const string &siena_uri, INAddress::port_type p = 0)
  creates a `SimpleSiena` that identifies itself using the given URI and that receives notifications at the given port
void main_loop()
  enters the main loop waiting for notifications

### Inherited from Siena:

### Public Fields

static const char* Version

### Public Methods

virtual void publish(const Event &e)
virtual void subscribe(const Filter &f, Notifiable *n)
virtual void subscribe(const Pattern &p, Notifiable *n)
virtual void unsubscribe(const Filter &f, Notifiable *n)
virtual void unsubscribe(const Pattern &p, Notifiable *n)
virtual void advertise(const Filter &f)
virtual void unadvertise(const Filter &)
virtual void disconnect(Notifiable *)
virtual void suspend(Notifiable *n)
virtual void resume(Notifiable *)

## Documentation

> `SimpleSiena` implements the client API of Siena.

> Example:

>         SimpleSiena * S;
>         S = new SimpleSiena("senp://milano:1969", 1969);
>         Event e;
>         e["price"]=100;
>         e["stock"]="XYZ";

>         S->publish(e);

>         Notifiable * N;
>         //...
>         Filter f;
>         f.add_filter("stock", Siena_eq, "ZYX");
>         S->subscribe(f, N);
>         S->main_loop();

> This implementation of `Siena` receives notifications using the Siena Event Notification Protocol transmitted on a TCP socket.

> Notifications can be received and processed by the corresponding interested parties (`Notifiable`s) when the `SienaClient` is in its `main_loop`. Notifications are processed one by one.

`SimpleSiena(const string &siena_uri, INAddress::port_type p = 0)`
  creates a `SimpleSiena` that identifies itself using the given URI and that receives notifications at the given port
  Parameters:
    siena_uri - is the URI that will be used to identify `this` client.
    p - is the port number that this client uses to receive notifications.

`void main_loop()`
  enters the main loop waiting for notifications

This class has no child classes.

See Also:
  Siena Notifiable

Alphabetic index HTML hierarchy of classes or Java

This document is part of Siena. Please, direct any comment or suggestion to Antonio Carzaniga