LibCT 2.0
Classes | Typedefs | Enumerations | Functions | Variables

LibCT Namespace Reference

Classes

class  ConversationNode
 A ConversationNode is the root node of a conversation. More...
class  DecisionNode
 A DecisionNode represents a hub where the conversation can go in one of two ways. More...
class  DoubleValue
 A DoubleValue is a specialised TemplateVariable for holding double values. More...
class  EventData
 EventData is a container for arbritaty data that can be sent with an event. More...
class  EventListener
 EventListener is a base class that all classes wishing to recieve events should derive from. More...
class  EventManager
 EventManager holds all the currently used events. More...
class  EventOccurance
 An EventOccurance is passed to all listening classes when an event occurs. More...
class  EventType
 EventType represents a specific event and stores all the listeners for that event. More...
class  Exception
 A base class for all LibCT exceptions. More...
struct  ExceptionCodeType
 Template struct which creates a distinct type for each exception code. More...
class  IOException
 A class representing an IO exception. More...
class  VariableException
 A class representing a Variable exception. More...
class  ExceptionFactory
 A class impementing dispatch methods. More...
class  FloatValue
 A FloatValue is a specialised TemplateVariable for holding float values. More...
class  Functor
 Functor is a base class used to store function pointers. More...
class  GlobalVars
 GlobalVars is a singleton variable container for holding global variables. More...
struct  CnvHeader
 CnvHeader is the layout for the binary header. More...
class  InputStream
 InputStream is a base class for reading binary data. More...
class  IntValue
 A IntValue is a specialised TemplateVariable for holding int values. More...
class  Logger
 A logger to allow the code to log messages. More...
class  Node
 A Node is a class used as the base for all conversation tree items. More...
class  OutputStream
 OutputStream is a base class for writing binary data. More...
class  PhaseNode
 A PhaseNode contains text that is presented to the user, and a list of ChoiceNodes for the user to choose from. More...
class  StringValue
 A StringValue is a specialised TemplateVariable for holding string values. More...
class  TemplateFunctor
 TemplateFunctor is a class that allows storing pointers to member functions. More...
class  TemplateVariable
 A TemplateVariable is a general container for holding values. More...
class  VariableContainer
 VariableContainer is a class to hold an access user-defnied variables. More...
class  VariableInterface
 VariableInterface provides a general interface for all user-defined variables. More...

Typedefs

typedef std::list
< EventOccurance * > 
EventOccuranceList
 Typedef.
typedef std::list< ListenerHandleListenerHandleList
typedef std::map< std::string,
EventType * > 
EventList
 List of event types and string identifiers.
typedef std::pair< std::string,
EventType * > 
EventPair
 Pair consisting of a event type and string identifier.
typedef std::pair
< EventListener *, Functor * > 
ListenerPair
 Typedefs.
typedef std::set< ListenerPairListenerList
typedef std::pair< EventType
*, ListenerPair
ListenerHandle
typedef int NodeId
 All nodes had a unique NodeId.
typedef std::vector< Node * > NodeList
 Nodes will be stored in lists.
typedef std::map< std::string,
VariableInterface * > 
VariableList
 Typedefs.
typedef std::pair< std::string,
VariableInterface * > 
VariablePair

Enumerations

enum  EventListenerMode { EventListenerModeBuffered, EventListenerModeImmediate }
 

Listener mode.

More...
enum  ExceptionCode { ExceptionCodeIO, ExceptionCodeVariable, ExceptionCodeProject }
 

The code for an exception.

More...
enum  LogLevel { LogLevelCritical, LogLevelWarning, LogLevelPedantic }
 

The severity of the message being logged.

More...
enum  NodeType {
  NodeTypeConversation, NodeTypePhase, NodeTypeChoice, NodeTypeDecision,
  NodeTypeUnknown
}
 

List of the different types of node.

More...
enum  VariableType {
  VariableTypeInt, VariableTypeFloat, VariableTypeDouble, VariableTypeString,
  VariableTypeBool, VariableTypeCount, VariableTypeUnknown
}
 

List of all valid variable types.

More...
enum  VariableScope { VariableScopeGlobal, VariableScopeLocal, VariableScopeUnknown }
enum  VariableOperator {
  VariableOperatorEq, VariableOperatorNe, VariableOperatorLt, VariableOperatorLtEq,
  VariableOperatorGt, VariableOperatorGtEq, VariableOperatorUnknown
}

Functions

ChoiceNode (Node *pParent, const std::string &text)
 Constructor.
 ~ChoiceNode ()
 Destructor.
NodeGetNext ()
 ~FileInputStream ()
 Destructor.
virtual size_t Read (void *pData, size_t size)
virtual ~FileOutputStream ()
 Destructor.
virtual size_t Write (const void *pData, size_t size)
template<unsigned int size>
static std::string FormatString (const char *pFormat,...)
 Basically performs a sprintf but into a std::string.
bool SerialiseVariableContainer (VariableContainer *pContainer, OutputStream *pOutput)
bool SerialiseVariableContainer (VariableContainer *pContainer, InputStream *pInput)

Variables

__pad0__
 Event to fire when the choice is selected.
C const std::string & name
std::ifstream m_Stream
 Stream.

Detailed Description

This file is part of the LibCT project (http://libct.actstudios.co.uk)

Copyright (c) 2010 - 2011 Andrew Thorpe

This software is licensed under the MIT license

For more information, see LICENSE.TXT, or http://www.opensource.org/licenses/mit-license.php


Typedef Documentation

typedef std::map<std::string, EventType*> LibCT::EventList

List of event types and string identifiers.

Typedef.

typedef std::pair<std::string, EventType*> LibCT::EventPair

Pair consisting of a event type and string identifier.

typedef std::set<ListenerPair> LibCT::ListenerList
typedef std::pair<EventListener*, Functor*> LibCT::ListenerPair

Typedefs.

typedef int LibCT::NodeId

All nodes had a unique NodeId.

typedef std::vector<Node*> LibCT::NodeList

Nodes will be stored in lists.

typedef std::map<std::string, VariableInterface*> LibCT::VariableList

Typedefs.

typedef std::pair<std::string, VariableInterface*> LibCT::VariablePair

Enumeration Type Documentation

Listener mode.

Enumerator:
EventListenerModeBuffered 

Buffered.

EventListenerModeImmediate 

Immediate.

The code for an exception.

Enumerator:
ExceptionCodeIO 

IO exception.

ExceptionCodeVariable 

Variable exeption.

ExceptionCodeProject 

Project exception.

The severity of the message being logged.

Enumerator:
LogLevelCritical 

Unrecoverable error, usually paied with an exception.

LogLevelWarning 

Ignorable error, or non-optimal usage.

LogLevelPedantic 

Any other messages, usually not actually logged.

List of the different types of node.

Enumerator:
NodeTypeConversation 

Root, conversation type node.

NodeTypePhase 

Phase type node.

NodeTypeChoice 

Choice type node.

NodeTypeDecision 

Decision type node.

NodeTypeUnknown 

Error state.

Enumerator:
VariableOperatorEq 

Equals operator.

VariableOperatorNe 

Not Equals operator.

VariableOperatorLt 

Less Than operator.

VariableOperatorLtEq 

Less Than Equals operator.

VariableOperatorGt 

Greater Than operator.

VariableOperatorGtEq 

Greater Than Equals operator.

VariableOperatorUnknown 

Unknown operator, error case.

Enumerator:
VariableScopeGlobal 

Global scope variables, held on ConversationManager.

VariableScopeLocal 

Local scope variables, held on an individual Conversation.

VariableScopeUnknown 

Unknown scope, error case.

List of all valid variable types.

Enumerator:
VariableTypeInt 

Int variable.

VariableTypeFloat 

Float variable.

VariableTypeDouble 

Double variable.

VariableTypeString 

String variable.

VariableTypeBool 

Bool variable.

VariableTypeCount 

Count of valid variable types.

VariableTypeUnknown 

Unknown variable, used for error detection.


Function Documentation

C LibCT::ChoiceNode ( Node *  pParent,
const std::string &  text 
) [explicit]

Constructor.

template<unsigned int size>
static std::string LibCT::FormatString ( const char *  pFormat,
  ... 
) [static]

Basically performs a sprintf but into a std::string.

Parameters:
pFormatFormating string
Node* LibCT::GetNext ( )

Get active connection

Returns:
The node this one is actively connected to
virtual size_t LibCT::Read ( void *  pData,
size_t  size 
) [protected, virtual]

Read the data from the stream

Returns:
The size of the data written
Parameters:
pDataData to write
sizeSize of pData
bool LibCT::SerialiseVariableContainer ( VariableContainer *  pContainer,
OutputStream *  pOutput 
)

Serialise a VariableContainer to a stream

Returns:
True if it succeeds
bool LibCT::SerialiseVariableContainer ( VariableContainer *  pContainer,
InputStream *  pInput 
)

Serialise a VariableContainer from a stream

Returns:
True if it succeeds
virtual size_t LibCT::Write ( const void *  pData,
size_t  size 
) [protected, virtual]

Write the data to the stream

Returns:
The size of the data written
Parameters:
pDataData to write
sizeSize of pData
LibCT::~ChoiceNode ( )

Destructor.

LibCT::~FileInputStream ( )

Destructor.

virtual LibCT::~FileOutputStream ( ) [virtual]

Destructor.


Variable Documentation

Event to fire when the choice is selected.

std::ofstream LibCT::m_Stream

Stream.

C const std::string& LibCT::name