468,256 Members | 1,415 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,256 developers. It's quick & easy.

compiler madness??

g
#ifndef SERVICE_HANDLER_H_
#define SERVICE_HANDLER_H_
#include <string>
#include <map>

class Services;

class Service_Handler
{
public:
Service_Handler();
virtual ~Service_Handler();
Services* getService(std::string transaction,std::string arguments);
private:
std::map<std::string,Services*> transactions;
};

#endif /*SERVICE_HANDLER_H_*/
#include "Service_Handler.h"
#include "Services.h"
#include "CreateCustomer.h"

Service_Handler::Service_Handler()
{
transactions["aaa"]=new Services;
}

Service_Handler::~Service_Handler()
{
transactions.erase("aaa");
}

Services* getService(std::string transaction,std::string arguments)
{
transactions.erase("aaa");
return NULL;
}

.../Service_Handler.cpp: In function 'Services*
getService(std::string, std::string)':
.../Service_Handler.cpp:17: error: 'transactions' was not declared
in this scope
!!!!!!!!!!!!
how it's possible??????????
why I can't use transactions in getService()????
please help!

Mar 4 '06 #1
3 1443
g wrote:
#ifndef SERVICE_HANDLER_H_
#define SERVICE_HANDLER_H_
#include <string>
#include <map>

class Services;

class Service_Handler
{
public:
Service_Handler();
virtual ~Service_Handler();
Services* getService(std::string transaction,std::string arguments);
private:
std::map<std::string,Services*> transactions;
};

#endif /*SERVICE_HANDLER_H_*/
#include "Service_Handler.h"
#include "Services.h"
#include "CreateCustomer.h"

Service_Handler::Service_Handler()
{
transactions["aaa"]=new Services;
}

Service_Handler::~Service_Handler()
{
transactions.erase("aaa");
}

Services* getService(std::string transaction,std::string arguments)
{
transactions.erase("aaa");
return NULL;
}

../Service_Handler.cpp: In function 'Services*
getService(std::string, std::string)':
../Service_Handler.cpp:17: error: 'transactions' was not declared
in this scope
!!!!!!!!!!!!
how it's possible??????????
why I can't use transactions in getService()????
please help!


You forgot the scope for getService() it is:
Service_Handler::getService(). try it!
Mar 4 '06 #2
g wrote:
#ifndef SERVICE_HANDLER_H_
#define SERVICE_HANDLER_H_
#include <string>
#include <map>

class Services;

class Service_Handler
{
public:
Service_Handler();
virtual ~Service_Handler();
Services* getService(std::string transaction,std::string arguments);
I strongly recommend declaring your arguments 'std::string const &'.
private:
std::map<std::string,Services*> transactions;
};

#endif /*SERVICE_HANDLER_H_*/
#include "Service_Handler.h"
#include "Services.h"
#include "CreateCustomer.h"

Service_Handler::Service_Handler()
{
transactions["aaa"]=new Services;
}

Service_Handler::~Service_Handler()
{
transactions.erase("aaa");
}

Services* getService(std::string transaction,std::string arguments)
Did you mean

Services* Service_Handler::getService( ...

???
{
transactions.erase("aaa");
return NULL;
}

../Service_Handler.cpp: In function 'Services*
getService(std::string, std::string)':
../Service_Handler.cpp:17: error: 'transactions' was not declared
in this scope
!!!!!!!!!!!!
how it's possible??????????
why I can't use transactions in getService()????


You need to make sure you're actually defining a _member_.

Don't be too hard on yourself. Those things happen.

V
--
Please remove capital As from my address when replying by mail
Mar 4 '06 #3
g
Ohhhh my god!!!!!!!!
I dont believe it.......so stupid:-)

thanks a lot!

Mar 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Lane LiaBraaten | last post: by
reply views Thread by rollasoc | last post: by
3 posts views Thread by Mark Rockman | last post: by
8 posts views Thread by - | last post: by
42 posts views Thread by Noah Roberts | last post: by
41 posts views Thread by Miroslaw Makowiecki | last post: by
1 post views Thread by =?Utf-8?B?SmFja2Rhdw==?= | last post: by
20 posts views Thread by raylopez99 | last post: by
reply views Thread by Pavel Minaev | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.