Lumiera 0.pre.04~rc.1
»edit your freedom«
Loading...
Searching...
No Matches
example-plugin.cpp
Go to the documentation of this file.
1/*
2 ExamplePlugin - example plugin (C++) for testing the interface/plugin system
3
4 Copyright (C)
5 2008, Christian Thaeter <ct@pipapo.org>,
6 Hermann Vosseler <Ichthyostega@web.de>
7
8  **Lumiera** is free software; you can redistribute it and/or modify it
9  under the terms of the GNU General Public License as published by the
10  Free Software Foundation; either version 2 of the License, or (at your
11  option) any later version. See the file COPYING for further details.
12
13* *****************************************************************/
14
26#include "lib/format-string.hpp"
27
28extern "C" {
29#include "common/interface.h"
31
32#include "interface/say-hello.h"
33}
34
35#include <iostream>
36
37using std::cout;
38using std::endl;
39
40
41
43 {
44 public:
45 static LumieraInterface
47 {
48 static util::_Fmt fmt("opened %x global interfaces %x");
49 cout << fmt % self % interfaces << endl;
50 return self;
51 }
52
53 static void
55 {
56 cout << "dying" << endl;
57 }
58 };
59
60
62 : public ExamplePlugin
63 {
64 public:
65 static void
67 {
68 cout << "Hallo Welt!" << endl;
69 }
70
71 static void
73 {
74 cout << "Tschüss " << m << endl;
75 }
76 };
77
78
80 : public ExamplePlugin
81 {
82 public:
83 static void
85 {
86 cout << "Hello World!" << endl;
87 }
88
89 static void
91 {
92 cout << "Bye " << m << endl;
93 }
94 };
95
96
97
98
99extern "C" { /* ================== define two lumieraorg_testhello instance ======================= */
100
101
102
103 LUMIERA_EXPORT( /* ===================== PLUGIN EXPORTS ================================== */
104
105 LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0
106 ,lumieraorg_hello_german_cpp
107 , NULL /* no descriptor given */
110 , LUMIERA_INTERFACE_MAP (hello,
112 , LUMIERA_INTERFACE_MAP (goodbye,
114 ),
115 LUMIERA_INTERFACE_DEFINE (lumieraorg_testhello, 0
116 ,lumieraorg_hello_english_cpp
117 , NULL /* no descriptor given */
120 , LUMIERA_INTERFACE_MAP (hello,
122 , LUMIERA_INTERFACE_MAP (goodbye,
124 )
125 );
126
127} // extern "C"
static void servus(CStr m)
static void griazi()
static void bye(CStr m)
static void hello()
static void myclose(LumieraInterface)
static LumieraInterface myopen(LumieraInterface self, LumieraInterface interfaces)
A front-end for using printf-style formatting.
External interface to the lumiera configuration system.
const char * CStr
Definition error.hpp:42
void hello(void)
Front-end for printf-style string template interpolation.
A data record to describe interface, interface instances and plug-in instances.
Lumiera interface macros and structures.
#define LUMIERA_EXPORT(...)
Generate interface container suitable for enumerating interfaces.
Definition interface.h:273
lumiera_interface * LumieraInterface
Definition interface.h:355
return NULL
Definition llist.h:586
A mock interface to support testing of the interface system.