SimpleAI
 All Classes Namespaces Files Functions Variables Typedefs Macros Groups Pages
Macros
IFilter.h File Reference
#include <list>
#include <vector>
#include "ICharacter.h"
#include "AI.h"
#include "common/MemoryAllocator.h"
#include "common/Thread.h"
Include dependency graph for IFilter.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define FILTER_CLASS(FilterName)
 
#define FILTER_FACTORY(FilterName)
 
#define FILTER_ACTION_CLASS(FilterName)
 
#define FILTER_ACTION_FACTORY(FilterName)
 
#define FILTER_FACTORY_SINGLETON
 
#define FILTER_CLASS_SINGLETON(FilterName)
 

Macro Definition Documentation

#define FILTER_ACTION_CLASS (   FilterName)
Value:
FilterName(const std::string& parameters, const ::ai::Filters& filters) : \
::ai::IFilter(#FilterName, parameters), _filters(filters) { \
ai_assert(_filters.size() > 1, #FilterName " must contain at least two sub filters"); \
} \
protected: \
const ::ai::Filters _filters; \
public: \
virtual ~FilterName() { \
}
#define ai_assert(condition,...)
Provide your own assert - this is only executed in DEBUG mode.
Definition: Types.h:75
#define FILTER_ACTION_FACTORY (   FilterName)
Value:
public: \
class Factory: public ::ai::IFilterFactory { \
public: \
::ai::FilterPtr create (const ::ai::FilterFactoryContext *ctx) const override { \
return std::make_shared<FilterName>(ctx->parameters, ctx->filters); \
} \
}; \
static const Factory& getFactory() { \
static Factory FACTORY; \
return FACTORY; \
}
#define FILTER_CLASS (   FilterName)
Value:
explicit FilterName(const std::string& parameters = "") : \
::ai::IFilter(#FilterName, parameters) { \
} \
public: \
virtual ~FilterName() { \
}
#define FILTER_CLASS_SINGLETON (   FilterName)
Value:
private: \
FILTER_CLASS(FilterName) \
public: \
static ::ai::FilterPtr& get() { \
AI_THREAD_LOCAL FilterName* c = nullptr; \
if (c == nullptr) { c = new FilterName; } \
AI_THREAD_LOCAL ::ai::FilterPtr _instance(c); \
return _instance; \
} \
FILTER_FACTORY_SINGLETON
#define FILTER_FACTORY (   FilterName)
Value:
public: \
class Factory: public ::ai::IFilterFactory { \
public: \
::ai::FilterPtr create (const ::ai::FilterFactoryContext *ctx) const override { \
return std::make_shared<FilterName>(ctx->parameters); \
} \
}; \
static const Factory& getFactory() { \
static Factory FACTORY; \
return FACTORY; \
}
#define FILTER_FACTORY_SINGLETON
Value:
public: \
class Factory: public ::ai::IFilterFactory { \
::ai::FilterPtr create (const ::ai::FilterFactoryContext */*ctx*/) const override { \
return get(); \
} \
}; \
static const Factory& getFactory() { \
static Factory FACTORY; \
return FACTORY; \
}