ParCompMark::NetServer Class Reference

#include <PCMNetServer.h>

Inheritance diagram for ParCompMark::NetServer:

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

Collaboration graph
[legend]
List of all members.

Detailed Description

Network server class.

Definition at line 48 of file PCMNetServer.h.


Methods

virtual void initialize ()
 Initialize the class (server thread, broadcast send).
virtual void finalize ()
 Initialize the class (broadcast recieve thread).
virtual void sendBroadcastMessage (const std::string &type, const std::string &message)
 Send a broadcast message.
virtual void buildCluster ()
 Build cluster information.
virtual void task ()
 Thread for accept TCP/IP connection.

Public Types

typedef ParCompMark::Pointer<
NetServer, DummyLock
Pointer
 Type for pointer to this class.
typedef ParCompMark::Pointer<
int, Mutex
IntPointer
 Type for pointer to an int.

Public Member Functions

Constructors & destructor
 NetServer (const std::string &name)
 Create network class.
virtual ~NetServer ()
 The destructor.
Getters & setters
sockaddr_in & getBroadcastAddress () const
 Getter of mBroadcastAddress.
const u32getMaxConnection () const
 Getter of mMaxConnection.
const u32getHostNumber () const
 Getter of mHostNumber.
void setHostNumber (const u32 &hostnumber)
 Setter of mHostNumber.
const NetServer::IntPointergetRecievedNumber () const
 Getter of mRecievedNumber.
const NetServer::IntPointergetStopFrameID () const
 Getter of mStopFrameID.

Protected Attributes

Variables
sockaddr_in mBroadcastAddress
 The broadcast address structure for send later time.
u32 mMaxConnection
 
u32 mHostNumber
 Number if the host in the cluster.
IntPointer mRecievedNumber
 Number of the recieved message for a broadcast.
IntPointer mStopFrameID
 Frame id for stop PC.

Member Typedef Documentation

Type for pointer to an int.

Definition at line 70 of file PCMNetServer.h.

Type for pointer to this class.

Reimplemented from ParCompMark::Network.

Definition at line 66 of file PCMNetServer.h.


Constructor & Destructor Documentation

ParCompMark::NetServer::NetServer ( const std::string &  name  ) 

Create network class.

Parameters:
[in] name Name of the network.

Definition at line 38 of file PCMNetServer.cpp.

References ParCompMark::Network::getIP(), ParCompMark::Pointer< T, Lock >::getPtr(), initialize(), mHostNumber, mMaxConnection, and mStopFrameID.

Here is the call graph for this function:

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

The destructor.

This class has virtual destructor.

Definition at line 65 of file PCMNetServer.cpp.

References finalize(), and ParCompMark::Network::mInitialized.

Here is the call graph for this function:


Member Function Documentation

void ParCompMark::NetServer::buildCluster (  )  [virtual]

Build cluster information.

Definition at line 202 of file PCMNetServer.cpp.

References ParCompMark::Singleton< T >::getInstance(), mHostNumber, sendBroadcastMessage(), and ParCompMark::Timer::sleep().

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

Here is the call graph for this function:

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

Initialize the class (broadcast recieve thread).

Definition at line 149 of file PCMNetServer.cpp.

References Assert, ParCompMark::Network::mBroadcastSocket, ParCompMark::Network::mInitialized, and ParCompMark::Network::mStreamSocket.

Referenced by ~NetServer().

struct sockaddr_in & ParCompMark::NetServer::getBroadcastAddress (  )  const [inline]

Getter of mBroadcastAddress.

Returns value of mBroadcastAddress.

Returns:
The value of mBroadcastAddress

Definition at line 270 of file PCMNetServer.h.

const u32 & ParCompMark::NetServer::getHostNumber (  )  const [inline]

Getter of mHostNumber.

Returns value of mHostNumber.

Returns:
The value of mHostNumber

Definition at line 284 of file PCMNetServer.h.

const u32 & ParCompMark::NetServer::getMaxConnection (  )  const [inline]

Getter of mMaxConnection.

Returns value of mMaxConnection.

Returns:
The value of mMaxConnection

Definition at line 277 of file PCMNetServer.h.

const NetServer::IntPointer & ParCompMark::NetServer::getRecievedNumber (  )  const [inline]

Getter of mRecievedNumber.

Returns value of mRecievedNumber.

Returns:
The value of mRecievedNumber

Definition at line 298 of file PCMNetServer.h.

const NetServer::IntPointer & ParCompMark::NetServer::getStopFrameID (  )  const [inline]

Getter of mStopFrameID.

Returns value of mStopFrameID.

Returns:
The value of mStopFrameID

Definition at line 305 of file PCMNetServer.h.

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

void ParCompMark::NetServer::sendBroadcastMessage ( const std::string &  type,
const std::string &  message 
) [virtual]

void ParCompMark::NetServer::setHostNumber ( const u32 hostnumber  )  [inline]

Setter of mHostNumber.

Sets value of mHostNumber.

Parameters:
[in] hostnumber The value of mHostNumber

Definition at line 291 of file PCMNetServer.h.

void ParCompMark::NetServer::task (  )  [protected, virtual]


Member Data Documentation

struct sockaddr_in ParCompMark::NetServer::mBroadcastAddress [protected]

The broadcast address structure for send later time.

Remarks:
This is own attribute of this class.

Definition at line 86 of file PCMNetServer.h.

Referenced by initialize(), and sendBroadcastMessage().

Number if the host in the cluster.

Remarks:
This is own attribute of this class.

Definition at line 100 of file PCMNetServer.h.

Referenced by buildCluster(), NetServer(), and sendBroadcastMessage().

Remarks:
This is own attribute of this class.

Definition at line 93 of file PCMNetServer.h.

Referenced by initialize(), and NetServer().

Number of the recieved message for a broadcast.

Remarks:
This is own attribute of this class.

Definition at line 107 of file PCMNetServer.h.

Referenced by initialize(), and sendBroadcastMessage().

Frame id for stop PC.

Remarks:
This is own attribute of this class.

Definition at line 114 of file PCMNetServer.h.

Referenced by NetServer().


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