I am getting a parse error, but I can't figure out why. I have a static class defined as such:
ConcreteFactory.h
/*
* ConcreteFactory.h
* Symphony Engine
*
* Created by Corey Hoffstein on 8/31/05.
* Copyright 2005 Corey Hoffstein. All rights reserved.
*
*/
#ifndef __CONCRETEFACTORY_H__
#define __CONCRETEFACTORY_H__
//#include "precompiled.h"
#include "Logger.h"
#include "AudioCore.h"
#include "InputManager.h"
#include "ResourceCore.h"
#include "ObjectFactory.h"
namespace Symphony
{
class ConcreteFactory
{
private:
static Logger *l;
static AudioCore *ac;
static InputManager *im;
static ResourceCore *rc;
static ObjectFactory *of;
public:
ConcreteFactory()
{
}
~ConcreteFactory()
{
}
static inline void createFactory()
{
l = new Logger();
ac = new AudioCore();
im = new InputManager();
rc = new ResourceCore();
of = new ObjectFactory();
}
static inline void destroyFactory()
{
//delete our audio core, input manager, and resource core
if(ac) delete ac;
if(im) delete im;
if(rc) delete rc;
//delete the object factory
if(of) delete of;
//close our logger
if(l) delete l;
}
static inline Logger *getLogger()
{
return l;
}
static inline AudioCore *getAudioCore()
{
return ac;
}
static inline InputManager *getInputManager()
{
return im;
}
static inline ResourceCore *getResourceCore()
{
return rc;
}
static inline ObjectFactory *getObjectFactory()
{
return of;
}
};
}
#endif
ConcreteFactory.cpp
/*
* ConcreteFactory.cpp
* Symphony Engine
*
* Created by Corey Hoffstein on 8/31/05.
* Copyright 2005 Corey Hoffstein. All rights reserved.
*
*/
#include "ConcreteFactory.h"
using namespace Symphony;
Logger *ConcreteFactory::l = NULL;
AudioCore *ConcreteFactory::ac = NULL;
InputManager *ConreteFactory::im = NULL;
ResourceCore *ConreteFactory::rc = NULL;
ObjectFactory *ConreteFactory::of = NULL;
Everything seems fine to me -- maybe not? Anyway, so I try to use it like this:
#include "ConcreteFactory.h"
...
ptr = ConcreteFactory::getObjectFactory()->createInstance(name, ptr);
And this is the error:
error: parse error before `;' token
Thoughts about this?
Thanks.