Today it's the day of strange things.... Got a stupid hpp file and another stupid cpp file trying to implement a stupid class. Here they are:
// HPP
#ifndef _WFQUEUE_MANAGER_PROXY_HPP_
#define _WFQUEUE_MANAGER_PROXY_HPP_
#include <iostream>
#include <string>
#include "workflow.hpp"
#include "wfqueue.hpp"
//-----------------------------------------------------------------------------
// Enum, struct, aliases
namespace middleware {
typedef struct {
std::string proxy_ipaddr; /* IP address to manager */
std::string proxy_port; /* Port to manager */
} WFProxyConfig;
}
//-----------------------------------------------------------------------------
// Class definitions
namespace middleware {
/*!
* This class provides network interface to access the workflow queue. It is
* important to notice that constructor is private in order to let a factory
* perform such a work.
*/
class WFQueueManagerProxy : public WFQueue {
/*!
* To let factory build properly this object, we provide access to every
* part of it.
*/
friend class WFQueueProxyFactory;
private:
/*!
* Privately constructs the object. Default configuration with loopback
* address and invalid port.
*/
WFQueueManagerProxy();
public:
/*!
* Destructor
*/
~WFQueueManagerProxy();
/*!
* Enqueues a workflow.
*/
void enqueue(const Workflow& workflow);
/*!
* Dequeues a workflow.
*/
const Workflow& dequeue();
private:
/*!
* Privately constructs the object. Assigning configuration.
*/
void ConfigureProxy(WFProxyConfig conf);
/*!
* Parameters for proxy.
*/
WFProxyConfig _config;
}; /* WFQueueManagerProxy */
} /* middleware */
#endif
Here the other
// CPP
#include "wfqueue_manager_proxy.hpp"
using namespace middleware;
//-----------------------------------------------------------------------------
// Constructors and destructor
/* Private constructor */
WFQueueManagerProxy::WFQueueManagerProxy() {
(this->_config).proxy_ipaddr = "127.0.0.1";
(this->_config).proxy_port = "0";
}
/* Destructor */
WFQueueManagerProxy::~WFQueueManagerProxy() {
}
//-----------------------------------------------------------------------------
// Public members
/* Enqueue */
void WFQueueManagerProxy::enqueue(const Workflow& workflow) {
}
/* Dequeue */
const Workflow& WFQueueManagerProxy::dequeue() {
}
//-----------------------------------------------------------------------------
// Private members
void WFQueueManagerProxy::ConfigureProxy(WFProxyConfig conf) {
}
Somebody please explain me why g++ tells me this:
wfqueue_manager_proxy.cpp: In constructor ‘middleware::WFQueueManagerProxy::WFQueueManagerProxy()’: wfqueue_manager_proxy.cpp:32: error: ‘class middleware::WFQueueManagerProxy’ has no member named ‘_config’ wfqueue_manager_proxy.cpp:33: error: ‘class middleware::WFQueueManagerProxy’ has no member named ‘_config’ wfqueue_manager_proxy.cpp: At global scope: wfqueue_manager_proxy.cpp:51: error: variable or field ‘ConfigureProxy’ declared void wfqueue_manager_proxy.cpp:51: error: ‘WFProxyConfig’ was not declared in this scope
ABSURD... It does not recognize that typedef and doesn't recognize a private member too... and, more than everything... why does not g++ recognize a member function trying to see it as a variable?????????
I have tried everything... PS (to who saw my earlier post): my virtual machine now is not the cause. I checked and got confirm that no virtual hard disk is corrupted or in collision with other virtual mem units.
Workflow
andWFQueue
classes this compiles fine for me using g++ 4.2.1 and clang++ 2.8. - Nate