9#ifndef LDNDC_INPUT_EVENT_FACTORIES_H_
10#define LDNDC_INPUT_EVENT_FACTORIES_H_
12#include "event/events/eventbase.h"
14namespace ldndc{
namespace event{
15struct CBM_API abstract_event_factory_t
17 abstract_event_factory_t() {}
18 virtual ~abstract_event_factory_t() = 0;
19 virtual ldndc::event::event_type_e event_type()
const = 0;
21 virtual Event * construct(
22 lid_t
const &, event_attribute_t **)
const = 0;
23 static void destroy( Event * _event)
25 CBM_DefaultAllocator->destroy( _event);
29template <
typename _E,
typename _A >
30struct event_factory_t :
public abstract_event_factory_t
33 : abstract_event_factory_t()
36 ldndc::event::event_type_e event_type()
39 return (ldndc::event::event_type_e)_E::event_type_;
42 Event * construct( lid_t
const & _id,
43 event_attribute_t ** _attribs)
46 _A * attr = CBM_DefaultAllocator->construct< _A >();
49 *_attribs =
static_cast< event_attribute_t *
>( attr);
51 return static_cast< Event *
>( CBM_DefaultAllocator->construct_args< _E >(
52 static_cast< size_t >( 1), _id, attr));
56extern CBM_API abstract_event_factory_t
const * event_factory[EVENT_CNT];
57extern CBM_API event_attribute_t
const * event_attribute_defaults[EVENT_CNT];
Spatially explicit groundwater model.
Definition airchemistryput.h:15