1 /* Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
2 
3 This program is free software; you can redistribute it and/or modify
4 it under the terms of the GNU General Public License, version 2.0,
5 as published by the Free Software Foundation.
6 
7 This program is also distributed with certain software (including
8 but not limited to OpenSSL) that is licensed under separate terms,
9 as designated in a particular file or component or in included license
10 documentation.  The authors of MySQL hereby grant you an additional
11 permission to link the program and your derivative works with the
12 separately licensed software that they have included with MySQL.
13 
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 GNU General Public License, version 2.0, for more details.
18 
19 You should have received a copy of the GNU General Public License
20 along with this program; if not, write to the Free Software
21 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301  USA */
22 
23 #include <mysql/components/component_implementation.h>
24 #include <mysql/components/service.h>
25 #include <mysql/components/service_implementation.h>
26 #include "example_math_wrapping_imp.h"
27 #include "example_services.h"
28 
29 /**
30   This file contains a definition of the example_component3.
31 */
32 
33 /* This component provides an implementation for 'example_math' Service only. */
34 BEGIN_SERVICE_IMPLEMENTATION(example_component3, example_math)
35 example_math_wrapping_imp::calculate_gcd, END_SERVICE_IMPLEMENTATION();
36 
37 BEGIN_COMPONENT_PROVIDES(example_component3)
38 PROVIDES_SERVICE(example_component3, example_math), END_COMPONENT_PROVIDES();
39 
40 /* A block for specifying dependencies of this Component. Note that for each
41   dependency we need to have a placeholder, a extern to placeholder in
42   header file of the Component, and an entry on requires list below. */
43 REQUIRES_SERVICE_PLACEHOLDER(greetings);
44 REQUIRES_SERVICE_PLACEHOLDER(greetings_localization);
45 
46 /* A list of dependencies. */
47 BEGIN_COMPONENT_REQUIRES(example_component3)
48 REQUIRES_SERVICE(greetings), REQUIRES_SERVICE(greetings_localization),
49     END_COMPONENT_REQUIRES();
50 
51 /* A list of metadata to describe the Component. */
52 BEGIN_COMPONENT_METADATA(example_component3)
53 METADATA("mysql.author", "Oracle Corporation"),
54     METADATA("mysql.license", "GPL"), METADATA("test_property", "3"),
55     END_COMPONENT_METADATA();
56 
57 /* Declaration of the Component, this is the case when we don't need
58   initialization/de-initialization methods, so we are fine to just use NULL
59   values here. */
60 DECLARE_COMPONENT(example_component3, "mysql:example_component3")
61 nullptr, nullptr END_DECLARE_COMPONENT();
62 
63 /* Defines list of Components contained in this library. Note that for now
64   we assume that library will have exactly one Component. */
65 DECLARE_LIBRARY_COMPONENTS &COMPONENT_REF(example_component3)
66     END_DECLARE_LIBRARY_COMPONENTS
67