mycq::MyCQFactory Class Reference

Provides methods for getting MyCQClient instance and QueueSchema instance. More...

#include <MyCQFactory.h>

List of all members.

Static Public Member Functions

static MyCQClientgetMyCQClient ()
 Get a new MyCQClient instance.
static void close (MyCQClient *client)
 Close MyCQClient instance.
static QueueSchemagetQueueSchema ()
 Get a new QueueSchema instance.
static void close (QueueSchema *queueSchema)
 Close QueueSchema instance.

Detailed Description

Provides methods for getting MyCQClient instance and QueueSchema instance.

#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

static void mycq::MyCQFactory::close ( QueueSchema queueSchema  )  [static]

Close QueueSchema instance.

static void mycq::MyCQFactory::close ( MyCQClient client  )  [static]

Close MyCQClient instance.

static MyCQClient* mycq::MyCQFactory::getMyCQClient (  )  [static]

Get a new MyCQClient instance.

Returns:
MyCQClient instance.
static QueueSchema* mycq::MyCQFactory::getQueueSchema (  )  [static]

Get a new QueueSchema instance.

Returns:
QueueSchema instance.

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.