acedia Namespace Reference

This is the root namespace of acedia. More...

Namespaces

namespace  exit_reasons
 

This namespace encapsulates all by acedia defined exit reasons of actors.


namespace  util
 

Utility classes and templates.


Classes

class  AbstractActor
 Describes all possible operations on an actor. A concrete actor may be one of Actor or ActorProxy. More...
class  PublishingResult
 Stores the result of a publish-call. More...
class  String
 String is a thread safe wrapper around std::string that uses implicit sharing. More...
class  Actor
 This class describes an actor. More...
class  ActorProxy
 An ActorProxy is an actor that runs on a different node in the network. More...
class  ActorRef
 ActorRef describes a reference (or link) to a local actor or proxy. More...
class  Any
 A class that can hold any value. More...
class  AnyArray
 Describes an immutable, fixed-length array. More...
struct  Unit
 Unit is analogue to void. More...
class  Either
 Represents a value of one of two possible types (Left or Right). More...
class  Exception
 Base class for all acedia exceptions. More...
struct  NullPointerException
 Thrown to indicate that you tried to invoke a method on a null pointer. More...
class  ClassCastException
 Thrown by Any to indicate that your requestet type doesn't match the internal stored type. More...
struct  NotDeserializableException
 Thrown to indicate that the given string could not be deserialized. More...
struct  IndexOutOfBoundsException
 Thrown to indicate that an index is out of range. More...
class  ActorKilledException
 Thrown if an actor was killed (e.g. because a linked actor died). More...
struct  IOException
 Thrown to indicate that an IO operation failed. More...
struct  WSAStartupFailedException
 Thrown to indicate that WSAStartup failed. This exception is thrown only on the windows plattform. More...
class  Message
 The Message class provides an immutable, fixed-length array. More...
struct  MetaClass
 MetaClass holds informations about data types. More...
class  MockActor
 A MockActor is intended to connect a 'plain-old-thread' with acedia actors. More...
class  ReferenceCounted
 Base class for reference counted objects. More...
struct  ToStringConverter
 Extendable toString feature of acedia. More...
class  Tuple
 Tuples are immutable containers and can contain different types of elements. More...

Typedefs

typedef boost::int32_t ActorState
 Describes the current state of execution of an actor.

Enumerations

enum  PublishingError { NO_PUBLISHING_ERROR, SERVER_SOCKET_ERROR, BINDING_ERROR }
 

Describes all possible errors that could occur by publishing an actor.

More...
enum  ConnectionError {
  NO_CONNECTION_ERROR, CONNECTION_SOCKET_ERROR, NO_SUCH_HOST_ERROR, COULD_NOT_CONNECT_TO_HOST_ERROR,
  INCOMPATIBLE_ACEDIA_VERSIONS_ERROR, INCOMPATIBLE_HOST_ERROR
}
 

Describes all possible errors that could occur by connecting to a remote actor.

More...

Functions

void waitForAllActorsDone ()
 Synchronization method to wait until all actors are done.
MatchAllRuleBuilder others () throw ()
 Create a pattern that matches anything.
template<typename T1 >
SingleRuleBuilder< T1 > on ()
 Create a pattern that matches instances of T1.
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
RuleBuilder< 5, 0, T1, T2, T3,
T4, T5 > 
on ()
 Create a pattern that matches <T1, T2, T3, T4, T5>.
void discard ()
 A void functions that does nothing.
void link (ActorRef actor1, ActorRef actor2)
 Link actor1 and actor2.
template<class A , typename T1 >
ActorRef spawn (const T1 &v1)
 Spawn a new instance of T.
template<class A , typename T1 , typename T2 >
ActorRef spawn (const T1 &v1, const T2 &v2)
template<class A , typename T1 , typename T2 , typename T3 >
ActorRef spawn (const T1 &v1, const T2 &v2, const T3 &v3)
template<class A , typename T1 , typename T2 , typename T3 , typename T4 >
ActorRef spawn (const T1 &v1, const T2 &v2, const T3 &v3, const T4 &v4)
bool registerName (const String &name, const ActorRef &actor)
 Globally register a name for an actor.
void unregisterName (const String &name)
 Remove a globally registered name for an actor.
ActorRef whereisName (const String &name)
 Get the actor with a given globally registered name.
StringList registeredNames ()
 Get all globally registered names.
template<typename T >
GuardFunctor< T > * isEq (const T &x)
 Creates a guard that checks if a value is EQual x.
template<typename T >
GuardFunctor< T > * isNe (const T &x)
 Creates a guard that checks if a value is Not Equal x.
template<typename T >
GuardFunctor< T > * isGt (const T &x)
 Creates a guard that checks if a value is Greater Than x.
template<typename T >
GuardFunctor< T > * isLt (const T &x)
 Creates a guard that checks if a value is Less Than x.
void shutdown ()
 Quit an acedia based application.
void setAppInfo (const char *appName, boost::uint32_t majorVersion, boost::uint32_t minorVersion, boost::uint32_t minCompatibleMajorVersion, boost::uint32_t minCompatibleMinorVersion, bool allowNewerMinorVersion=false, bool allowNewerMajorVersion=false)
 Set all by the network layer needed informations about your application.
PublishingResult publish (ActorRef actor, boost::uint16_t port)
 Publish actor at the given port.
void closeConnections (ActorRef actor)
 Close all connection that are associated to actor.
void closeConnection (ActorRef actor, boost::uint16_t port)
 Close port if it is associated with actor.

Detailed Description

This is the root namespace of acedia.

Creates a hardware memory barrier (fence).

The acedia namespace encapsulates functions like spawn and all main classes.

A memory barrier prevents the CPU (and the compiler) from re-ordering read and write operations around the barrier.


Enumeration Type Documentation

Describes all possible errors that could occur by connecting to a remote actor.

Enumerator:
NO_CONNECTION_ERROR 

Indicates that there was no error.

CONNECTION_SOCKET_ERROR 

Indicates that the socket can't be created or opened.

NO_SUCH_HOST_ERROR 

Indicates that the host name was not found.

COULD_NOT_CONNECT_TO_HOST_ERROR 

Indicates that the host rejected the connection.

INCOMPATIBLE_ACEDIA_VERSIONS_ERROR 

Indicates that the host uses an incompatible version of the acedia library.

INCOMPATIBLE_HOST_ERROR 

Indicates that the appliation on the host site is incompatible with your application.

Definition at line 114 of file acedia_network.hpp.

Describes all possible errors that could occur by publishing an actor.

Enumerator:
NO_PUBLISHING_ERROR 

Indicates that there was no error.

SERVER_SOCKET_ERROR 

Indicates that the server socket can't be created/opened for some reason.

BINDING_ERROR 

Indicates that it wasn't possible to bind the socket to the specified port. This error occurs if the port is in use by another socket.

Definition at line 40 of file acedia_network.hpp.


Function Documentation

void acedia::closeConnections ( ActorRef  actor  ) 

Close all connection that are associated to actor.

This operation closes all connections that were opened with publish.

void acedia::discard (  ) 

A void functions that does nothing.

This function provides an easy way to define 'throw-away-rules' like others() >> discard.

Definition at line 85 of file acedia.cpp.

template<typename T >
GuardFunctor<T>* acedia::isEq ( const T &  x  )  [inline]

Creates a guard that checks if a value is EQual x.

Parameters:
x This guard returns true if {value} == x

Definition at line 264 of file acedia.hpp.

template<typename T >
GuardFunctor<T>* acedia::isGt ( const T &  x  )  [inline]

Creates a guard that checks if a value is Greater Than x.

Parameters:
x This guard returns true if {value} > x
Examples:
networkPong.cpp, and pong.cpp.

Definition at line 298 of file acedia.hpp.

template<typename T >
GuardFunctor<T>* acedia::isLt ( const T &  x  )  [inline]

Creates a guard that checks if a value is Less Than x.

Parameters:
x This guard returns true if {value} < x

Definition at line 315 of file acedia.hpp.

template<typename T >
GuardFunctor<T>* acedia::isNe ( const T &  x  )  [inline]

Creates a guard that checks if a value is Not Equal x.

Parameters:
x This guard returns true if {value} != x

Definition at line 281 of file acedia.hpp.

MatchAllRuleBuilder acedia::others (  )  throw () [inline]

Create a pattern that matches anything.

This functions is useful to define a default pattern.

Definition at line 114 of file acedia.hpp.

StringList acedia::registeredNames (  ) 

Get all globally registered names.

Returns:
a list of all registered names.
bool acedia::registerName ( const String &  name,
const ActorRef &  actor 
)

Globally register a name for an actor.

Predefined name(s): acedia_TimeEmitter.

Examples:
timedPong.cpp.

Definition at line 648 of file acedia.cpp.

void acedia::setAppInfo ( const char *  appName,
boost::uint32_t  majorVersion,
boost::uint32_t  minorVersion,
boost::uint32_t  minCompatibleMajorVersion,
boost::uint32_t  minCompatibleMinorVersion,
bool  allowNewerMinorVersion = false,
bool  allowNewerMajorVersion = false 
)

Set all by the network layer needed informations about your application.

Parameters:
appName name of the application
majorVersion major version of this release
minorVersion minor version of this release
minCompatibleMajorVersion minimum major version of compatible clients
minCompatibleMinorVersion minimum minor version of compatible clients
allowNewerMinorVersion allow clients to have a newer minor version than the running application
allowNewerMajorVersion allow clients to have a newer major version than the running application

Definition at line 676 of file acedia.cpp.

template<class A , typename T1 , typename T2 , typename T3 , typename T4 >
ActorRef acedia::spawn ( const T1 &  v1,
const T2 &  v2,
const T3 &  v3,
const T4 &  v4 
) [inline]
See also:
template<class T, typename A> inline static ActorRef spawn(A a)

Definition at line 220 of file acedia.hpp.

template<class A , typename T1 , typename T2 , typename T3 >
ActorRef acedia::spawn ( const T1 &  v1,
const T2 &  v2,
const T3 &  v3 
) [inline]
See also:
template<class T, typename A> inline static ActorRef spawn(A a)

Definition at line 211 of file acedia.hpp.

template<class A , typename T1 , typename T2 >
ActorRef acedia::spawn ( const T1 &  v1,
const T2 &  v2 
) [inline]
See also:
template<class T, typename A> inline static ActorRef spawn(A a)

Definition at line 202 of file acedia.hpp.

template<class A , typename T1 >
ActorRef acedia::spawn ( const T1 &  v1  )  [inline]

Spawn a new instance of T.

Spawn a new instance of T which must provide a constructor which takes exactly one argument of type A and return an ActorRef to it.

Returns:
a reference to the spawned actor

Definition at line 193 of file acedia.hpp.

void acedia::waitForAllActorsDone (  ) 

Synchronization method to wait until all actors are done.

This method blocks until all actors are done.

Examples:
networkPong.cpp, and timedPong.cpp.

Definition at line 570 of file acedia.cpp.

ActorRef acedia::whereisName ( const String &  name  ) 

Get the actor with a given globally registered name.

Returns:
the corresponing actor to name
Note:
use ActorRef::isValid to verify the result of this function
Examples:
timedPong.cpp.

Definition at line 656 of file acedia.cpp.


Generated by  doxygen 1.6.2