mycq::MyCQClient Class Reference

Provides methods for connecting and closing to a MyCQ Server. More...

#include <MyCQClient.h>

List of all members.

Public Member Functions

virtual void connect (string destination, int port, string username, string password)=0
 Connect to a MyCQ Server. This method block while the connection is being established.
virtual void close ()=0
 Close the connection to a MyCQ server.
virtual bool isConnected ()=0
 Check if MyCQ client is connected to MyCQ server.
virtual UserManagergetUserManager ()=0
 Get a reference of a UserManager instance.
virtual QueueManagergetQueueManager ()=0
 Get a reference of QueueManager instance.
virtual CQManagergetCQManager ()=0
 Get a reference of CQManager instance.

Detailed Description

Provides methods for connecting and closing to a MyCQ Server.

#include <iostream>
#include "../MyCQClientCPP/MyCQClient.h"

using namespace mycq;

void examMyCQClient()
{
            //get a client instance
            MyCQClient* client = MyCQFactory::getMyCQClient();

            try
            {
                        //connect to server
                        client->connect("localhost", 3030, "root", "1234");
            }
            catch(MyCQException& ex)
            {
                        std::cout << "code:" << ex.getCode() << ", message:" << ex.getMessage();
            }

            //close
            client->close();

            //delete client instance
            MyCQFactory::close(client);
}

Member Function Documentation

virtual void mycq::MyCQClient::close (  )  [pure virtual]

Close the connection to a MyCQ server.

virtual void mycq::MyCQClient::connect ( string  destination,
int  port,
string  username,
string  password 
) [pure virtual]

Connect to a MyCQ Server. This method block while the connection is being established.

Parameters:
destination A destination address of a MyCQ server to connect.
port An integer greater than zero that contains the port to be used on destination.
username A user name of a MyCQ server to login.
password A password of a user name to login.
Exceptions:
MyCQException An error occurred while connect to a MyCQ server.
virtual CQManager* mycq::MyCQClient::getCQManager (  )  [pure virtual]

Get a reference of CQManager instance.

Returns:
A reference of a CQManager instance.
virtual QueueManager* mycq::MyCQClient::getQueueManager (  )  [pure virtual]

Get a reference of QueueManager instance.

Returns:
A reference of a QueueManager instance.
virtual UserManager* mycq::MyCQClient::getUserManager (  )  [pure virtual]

Get a reference of a UserManager instance.

Returns:
A reference of a UserManager reference.
virtual bool mycq::MyCQClient::isConnected (  )  [pure virtual]

Check if MyCQ client is connected to MyCQ server.

Returns:
Boolean value. true(connected), false(closed).

The documentation for this class was generated from the following file:
 All Classes Namespaces Functions Variables Enumerations Enumerator
MyCQ C++ User's Document. Copyright@MyCQ Inc., All Rights Reserved.