libpsynth 0.2.1
Classes | Namespaces | Defines
/home/raskolnikov/dev/psynth/trunk/src/psynth/graph/node_factory.hpp File Reference
#include <psynth/graph/node.hpp>
Include dependency graph for node_factory.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  psynth::graph::node_factory

Namespaces

namespace  psynth
namespace  psynth::graph

Defines

#define PSYNTH_DECLARE_NODE_FACTORY(T, name)
#define PSYNTH_DEFINE_NODE_FACTORY(T)

Define Documentation

#define PSYNTH_DECLARE_NODE_FACTORY (   T,
  name 
)
Value:
class T ## _factory : public ::psynth::graph::node_factory  \
    {                                                           \
    public:                                                     \
        psynth::graph::node* create (const audio_info& info)    \
        {                                                       \
            return new T (info);                                \
        }                                                       \
                                                                \
        void destroy (psynth::graph::node* obj)                 \
        {                                                       \
            delete obj;                                         \
        }                                                       \
        const char* get_name () {                               \
            return name;                                        \
        }                                                       \
    };                                                          \
T ## _factory& get_ ## T ## _factory();
#define PSYNTH_DEFINE_NODE_FACTORY (   T)
Value:
T ## _factory& get_ ## T ## _factory ()\
{\
    static T ## _factory s_factory;\
    return s_factory;\
}