ParCompMark::Host Class Reference

#include <PCMHost.h>

Inheritance diagram for ParCompMark::Host:

Inheritance graph
[legend]
Collaboration diagram for ParCompMark::Host:

Collaboration graph
[legend]
List of all members.

Detailed Description

Class for describe a hosts.

Definition at line 77 of file PCMHost.h.


Public Types

typedef ParCompMark::Pointer<
int, Mutex
IntPointer
 Type for pointer to an int.

Public Member Functions

Constructors & destructor
 Host (const std::string &name="(unknown host)", NetClient *netClient=NULL)
 Creates a host with a specified name.
virtual ~Host ()
 The destructor.
Getters & setters
const bool & getWait () const
 Getter of mWait.
const std::string & getName () const
 Getter of mName.
void setName (const std::string &name)
 Setter of mName.
const std::string & getLowLevelScript () const
 Getter of mLowLevelScript.
void setLowLevelScript (const std::string &lowlevelscript)
 Setter of mLowLevelScript.
Container< Node, Mutex
>::Pointer
getNodes ()
 Getter of mNodes.
const bool & getInitialized () const
 Getter of mInitialized.
OutputNode::PointergetOutputDocument ()
 Getter of mOutputDocument.
const PCid & getSessionID () const
 Getter of mSessionID.
NetClientgetNetClient () const
 Getter of mNetClient.
void setNetClient (const NetClient *netclient)
 Setter of mNetClient.
const Host::IntPointergetEndProcessCount () const
 Getter of mEndProcessCount.
void setEndProcessCount (const Host::IntPointer &endprocesscount)
 Setter of mEndProcessCount.
const int & getProcessCount () const
 Getter of mProcessCount.
const int & getID () const
 Getter of mID.
void setID (const int &id)
 Setter of mID.
const RealgetMessageSendingTime () const
 Getter of mMessageSendingTime.
void setMessageSendingTime (const Real &messagesendingtime)
 Setter of mMessageSendingTime.
Methods
virtual XDisplay::Pointer openXDisplay (const std::string &displayName="")
 Open an X display.
virtual XDisplay::Pointer getFirstXDisplay ()
 Return the first X Display on this host.
virtual void openXDisplays ()
 Automatically scan available X displays on this host and open them.
virtual void closeXDisplays ()
 Close all opened X displays.
virtual void initialize ()
 Initialize host from low level script.
virtual void finalize ()
 Finalize the host.
virtual NodecreateNode (const char *nodeName)
 Create node on this host.
virtual void start ()
 Start the nodes.
virtual u32 stop ()
 Stop the nodes.
virtual void collectData ()
 Collect data from nodes.
virtual void setFrameID (const u32 &frameID)
 Set the ending frameID of processes.

Static Public Member Functions

Scripting binding
static void squirrelGlue ()
 Static glue code method for Squirrel-C++ binding.
Class methods
static HostgetInstance ()
 Gets the instance of the singleton class.

Static Public Attributes

Class constants
static const std::string HOSTINITNUT = "scripts/framework/host-init.nut"
 Host initializer Squirrel script file (relative to the data directory).

Protected Attributes

Variables
bool mWait
 Node wait?.
std::string mName
 Name of the host (IP address).
SqVM::Pointer mSqVM
 Squirrel virtual machine.
std::string mLowLevelScript
 Squirrel low level script for initialization.
Container< XDisplay, Mutex
>::Pointer 
mXDisplays
 X Displays on this host.
Container< Node, Mutex
>::Pointer 
mNodes
 Nodes on this host.
bool mInitialized
 The host is initialized.
OutputNode::Pointer mOutputDocument
 Root of the output document on this host.
PCid mSessionID
 PC session ID.
NetClientmNetClient
 Pointer to the netclietn class.
IntPointer mEndProcessCount
 Count how many process end the rendering/compositing.
int mProcessCount
 Count how many processes are on the host.
int mID
 ID for the host.
Real mMessageSendingTime
 Network message sendign time.

Member Typedef Documentation

Type for pointer to an int.

Definition at line 118 of file PCMHost.h.


Constructor & Destructor Documentation

ParCompMark::Host::Host ( const std::string &  name = "(unknown host)",
NetClient netClient = NULL 
)

Creates a host with a specified name.

Parameters:
[in] name Name of the host.
[in] netClient Pointer to the network handler class.

Definition at line 51 of file PCMHost.cpp.

References ParCompMark::Singleton< T >::getInstance(), ParCompMark::Pointer< T, Lock >::getPtr(), mEndProcessCount, mInitialized, mLowLevelScript, mName, mNetClient, mProcessCount, mSessionID, mXDisplays, and ParCompMark::Logger::NOTICE.

Here is the call graph for this function:

ParCompMark::Host::~Host (  )  [virtual]

The destructor.

This class has virtual destructor.

Definition at line 90 of file PCMHost.cpp.

References finalize(), ParCompMark::Singleton< T >::getInstance(), ParCompMark::Pointer< T, Lock >::kill(), mInitialized, mName, mXDisplays, and ParCompMark::Logger::NOTICE.

Here is the call graph for this function:


Member Function Documentation

void ParCompMark::Host::closeXDisplays (  )  [virtual]

Close all opened X displays.

Definition at line 171 of file PCMHost.cpp.

References mXDisplays.

Referenced by ParCompMark::Application::finalizeSoldier().

void ParCompMark::Host::collectData (  )  [virtual]

Collect data from nodes.

Definition at line 339 of file PCMHost.cpp.

References mNodes, and mOutputDocument.

Referenced by ParCompMark::Client::handleMessage().

Node * ParCompMark::Host::createNode ( const char *  nodeName  )  [virtual]

Create node on this host.

Parameters:
[in] nodeName Name of the node (C string for squirrel compatibility).
Returns:
Pointer to the created node.

Definition at line 292 of file PCMHost.cpp.

References ParCompMark::Pointer< T, Lock >::getPtr(), ParCompMark::Pointer< T, Lock >::lock(), mNodes, and ParCompMark::Pointer< T, Lock >::unlock().

Referenced by squirrelGlue().

Here is the call graph for this function:

void ParCompMark::Host::finalize (  )  [virtual]

const Host::IntPointer & ParCompMark::Host::getEndProcessCount (  )  const [inline]

Getter of mEndProcessCount.

Returns value of mEndProcessCount.

Returns:
The value of mEndProcessCount

Definition at line 616 of file PCMHost.h.

Referenced by ParCompMark::Process::threadFinalize().

XDisplay::Pointer ParCompMark::Host::getFirstXDisplay (  )  [virtual]

Return the first X Display on this host.

Returns:
The first display on this host, on null if there are no opened displays.

Definition at line 152 of file PCMHost.cpp.

References mXDisplays.

Referenced by ParCompMark::Application::setEnvironmentVariablesToSquirrel().

const int & ParCompMark::Host::getID (  )  const [inline]

Getter of mID.

Returns value of mID.

Returns:
The value of mID

Definition at line 637 of file PCMHost.h.

const bool & ParCompMark::Host::getInitialized (  )  const [inline]

Getter of mInitialized.

Returns value of mInitialized.

Returns:
The value of mInitialized

Definition at line 581 of file PCMHost.h.

Host * ParCompMark::Host::getInstance (  )  [static]

Gets the instance of the singleton class.

Reimplemented for squirrel usage.

Returns:
Instance of the class

Reimplemented from ParCompMark::Singleton< T >.

Definition at line 108 of file PCMHost.cpp.

Referenced by ParCompMark::Application::finalizeSoldier(), ParCompMark::Client::handleMessage(), ParCompMark::Application::setEnvironmentVariablesToSquirrel(), ParCompMark::Application::soldierOperation(), squirrelGlue(), and ParCompMark::Process::threadFinalize().

const std::string & ParCompMark::Host::getLowLevelScript (  )  const [inline]

Getter of mLowLevelScript.

Returns value of mLowLevelScript.

Returns:
The value of mLowLevelScript

Definition at line 559 of file PCMHost.h.

const Real & ParCompMark::Host::getMessageSendingTime (  )  const [inline]

Getter of mMessageSendingTime.

Returns value of mMessageSendingTime.

Returns:
The value of mMessageSendingTime

Definition at line 651 of file PCMHost.h.

const std::string & ParCompMark::Host::getName (  )  const [inline]

Getter of mName.

Returns value of mName.

Returns:
The value of mName

Definition at line 545 of file PCMHost.h.

NetClient * ParCompMark::Host::getNetClient (  )  const [inline]

Getter of mNetClient.

Returns value of mNetClient.

Returns:
The value of mNetClient

Definition at line 602 of file PCMHost.h.

Container< Node, Mutex >::Pointer & ParCompMark::Host::getNodes (  )  [inline]

Getter of mNodes.

Returns value of mNodes.

Returns:
The value of mNodes

Definition at line 574 of file PCMHost.h.

OutputNode::Pointer & ParCompMark::Host::getOutputDocument (  )  [inline]

Getter of mOutputDocument.

Returns value of mOutputDocument.

Returns:
The value of mOutputDocument

Definition at line 588 of file PCMHost.h.

Referenced by ParCompMark::Client::handleMessage().

const int & ParCompMark::Host::getProcessCount (  )  const [inline]

Getter of mProcessCount.

Returns value of mProcessCount.

Returns:
The value of mProcessCount

Definition at line 630 of file PCMHost.h.

Referenced by ParCompMark::Process::threadFinalize().

const PCid & ParCompMark::Host::getSessionID (  )  const [inline]

Getter of mSessionID.

Returns value of mSessionID.

Returns:
The value of mSessionID

Definition at line 595 of file PCMHost.h.

const bool & ParCompMark::Host::getWait (  )  const [inline]

Getter of mWait.

Returns value of mWait.

Returns:
The value of mWait

Definition at line 538 of file PCMHost.h.

XDisplay::Pointer ParCompMark::Host::openXDisplay ( const std::string &  displayName = ""  )  [virtual]

Open an X display.

An X display can be opened several times, and does not have to be closed. The host will close it when it is destructed. When no parameter is set, the default display will be opened.

Parameters:
[in] displayName X display name
Returns:
Opened X Display

Definition at line 119 of file PCMHost.cpp.

References ParCompMark::Singleton< T >::getInstance(), ParCompMark::Pointer< T, Lock >::lock(), mName, mXDisplays, ParCompMark::Logger::NOTICE, and ParCompMark::Pointer< T, Lock >::unlock().

Referenced by openXDisplays().

Here is the call graph for this function:

void ParCompMark::Host::openXDisplays (  )  [virtual]

Automatically scan available X displays on this host and open them.

Definition at line 163 of file PCMHost.cpp.

References openXDisplay().

Referenced by ParCompMark::Application::soldierOperation().

Here is the call graph for this function:

void ParCompMark::Host::setEndProcessCount ( const Host::IntPointer endprocesscount  )  [inline]

Setter of mEndProcessCount.

Sets value of mEndProcessCount.

Parameters:
[in] endprocesscount The value of mEndProcessCount

Definition at line 623 of file PCMHost.h.

void ParCompMark::Host::setFrameID ( const u32 frameID  )  [virtual]

Set the ending frameID of processes.

Parameters:
[in] frameID StopID.

Definition at line 350 of file PCMHost.cpp.

References mNodes.

Referenced by ParCompMark::Client::handleMessage().

void ParCompMark::Host::setID ( const int &  id  )  [inline]

Setter of mID.

Sets value of mID.

Parameters:
[in] id The value of mID

Definition at line 644 of file PCMHost.h.

Referenced by ParCompMark::Client::handleMessage().

void ParCompMark::Host::setLowLevelScript ( const std::string &  lowlevelscript  )  [inline]

Setter of mLowLevelScript.

Sets value of mLowLevelScript.

Parameters:
[in] lowlevelscript The value of mLowLevelScript

Definition at line 566 of file PCMHost.h.

Referenced by ParCompMark::Client::handleMessage().

void ParCompMark::Host::setMessageSendingTime ( const Real messagesendingtime  )  [inline]

Setter of mMessageSendingTime.

Sets value of mMessageSendingTime.

Parameters:
[in] messagesendingtime The value of mMessageSendingTime

Definition at line 658 of file PCMHost.h.

Referenced by ParCompMark::Client::handleMessage().

void ParCompMark::Host::setName ( const std::string &  name  )  [inline]

Setter of mName.

Sets value of mName.

Parameters:
[in] name The value of mName

Definition at line 552 of file PCMHost.h.

Referenced by ParCompMark::Client::handleMessage().

void ParCompMark::Host::setNetClient ( const NetClient netclient  )  [inline]

Setter of mNetClient.

Sets value of mNetClient.

Parameters:
[in] netclient The value of mNetClient

Definition at line 609 of file PCMHost.h.

Referenced by ParCompMark::Application::soldierOperation().

static void ParCompMark::Host::squirrelGlue (  )  [inline, static]

Static glue code method for Squirrel-C++ binding.

This method should be call from each Squirrel virtual machines to generate the proper Squirrel glue code. To content of this method is fully autogenerated in the header implementation file, you should not modify it.

Definition at line 101 of file PCMHost.h.

References createNode(), and getInstance().

Referenced by ParCompMark::squirrelClassBindings().

Here is the call graph for this function:

void ParCompMark::Host::start (  )  [virtual]

Start the nodes.

Definition at line 307 of file PCMHost.cpp.

References ParCompMark::Singleton< T >::getInstance(), mName, mNodes, and ParCompMark::Logger::NOTICE.

Referenced by ParCompMark::Client::handleMessage().

Here is the call graph for this function:

u32 ParCompMark::Host::stop (  )  [virtual]

Stop the nodes.

Returns:
frameID

Definition at line 318 of file PCMHost.cpp.

References ParCompMark::Singleton< T >::getInstance(), mName, mNodes, and ParCompMark::Logger::NOTICE.

Referenced by ParCompMark::Client::handleMessage().

Here is the call graph for this function:


Member Data Documentation

const std::string ParCompMark::Host::HOSTINITNUT = "scripts/framework/host-init.nut" [static]

Host initializer Squirrel script file (relative to the data directory).

Remarks:
This is own attribute of this class.

Definition at line 134 of file PCMHost.h.

Referenced by initialize().

Count how many process end the rendering/compositing.

Remarks:
This is own attribute of this class.

Definition at line 222 of file PCMHost.h.

Referenced by Host(), and initialize().

int ParCompMark::Host::mID [protected]

ID for the host.

Remarks:
This is own attribute of this class.

Definition at line 236 of file PCMHost.h.

The host is initialized.

Remarks:
This is own attribute of this class.

Definition at line 194 of file PCMHost.h.

Referenced by finalize(), Host(), initialize(), and ~Host().

std::string ParCompMark::Host::mLowLevelScript [protected]

Squirrel low level script for initialization.

Remarks:
This is own attribute of this class.

Definition at line 173 of file PCMHost.h.

Referenced by Host(), and initialize().

Network message sendign time.

Remarks:
This is own attribute of this class.

Definition at line 243 of file PCMHost.h.

std::string ParCompMark::Host::mName [protected]

Name of the host (IP address).

Remarks:
This is own attribute of this class.

Definition at line 159 of file PCMHost.h.

Referenced by finalize(), Host(), initialize(), openXDisplay(), start(), stop(), and ~Host().

Pointer to the netclietn class.

Remarks:
This attribute references an attribute.

Definition at line 215 of file PCMHost.h.

Referenced by Host().

Nodes on this host.

Remarks:
This is own attribute of this class.

Definition at line 187 of file PCMHost.h.

Referenced by collectData(), createNode(), finalize(), initialize(), setFrameID(), start(), and stop().

Root of the output document on this host.

Remarks:
This is own attribute of this class.

Definition at line 201 of file PCMHost.h.

Referenced by collectData(), finalize(), and initialize().

Count how many processes are on the host.

Remarks:
This is own attribute of this class.

Definition at line 229 of file PCMHost.h.

Referenced by finalize(), Host(), and initialize().

PC session ID.

Remarks:
This is own attribute of this class.

Definition at line 208 of file PCMHost.h.

Referenced by Host(), and initialize().

Squirrel virtual machine.

Remarks:
This is own attribute of this class.

Definition at line 166 of file PCMHost.h.

Referenced by finalize(), and initialize().

bool ParCompMark::Host::mWait [protected]

Node wait?.

Remarks:
This is own attribute of this class.

Definition at line 152 of file PCMHost.h.

X Displays on this host.

Remarks:
This is own attribute of this class.

Definition at line 180 of file PCMHost.h.

Referenced by closeXDisplays(), getFirstXDisplay(), Host(), openXDisplay(), and ~Host().


The documentation for this class was generated from the following files: