Скачиваний:
20
Добавлен:
01.05.2014
Размер:
818 б
Скачать
#ifndef CPP004
#define CPP004

#include "Client.h"



#include <string.h>

int Client::getreq()
{
 return RequestNum;
}

Client::Client()
{
 RequestNum=0;
}

Client::Client(char W[30])
{
 strcpy(Name,W);
 RequestNum = 0;
};

void Client::GetName(char N[30])
{
 strcpy(N,Name);
}

void Client::Set(Client C)
{
 char N[30];
 C.GetName(N);
 SetName(N);
 RequestNum = C.getreq();
}

void  Client::SetReq(int R)
{
 RequestNum = R;
}

void Client::SetName(char N[30])
{
 strcpy(Name,N);
}

void Client::getmsg(char M[100])
{
 cout<<"Client "<<Name<<" incomming message: "<<endl
     <<M<<endl;
 SetReq(getreq() + 1);
}


int Client::sendrequest()
{
 if (RequestNum > 0)
  {
   RequestNum -= 1;
   return 1;
  };
 return 0;
}

Client::~Client(){};

#endif
Соседние файлы в папке l4bis