├── .gitignore
├── .gitmodules
├── CMakeLists.txt
├── CONTRIBUTING
├── LICENSE
├── README
├── README.md
├── cmake
└── find_fplutil.cmake
├── disttools
├── config.json
└── push_package.py
├── docs
├── generate_docs.py
└── src
│ ├── api_reference.md
│ ├── contributing.md
│ ├── doxyfile
│ ├── doxygen_layout.xml
│ ├── groups
│ ├── index.md
│ └── programmers_guide
│ ├── building
│ ├── building.md
│ ├── building_android.md
│ ├── building_linux.md
│ ├── building_osx.md
│ └── building_windows.md
│ ├── howto
│ ├── events.md
│ ├── graphs.md
│ ├── modules.md
│ └── nodes.md
│ └── overview.md
├── include
└── breadboard
│ ├── base_node.h
│ ├── event.h
│ ├── graph.h
│ ├── graph_factory.h
│ ├── graph_state.h
│ ├── log.h
│ ├── memory_buffer.h
│ ├── module.h
│ ├── module_registry.h
│ ├── modules
│ ├── common.h
│ ├── debug.h
│ ├── logic.h
│ ├── math.h
│ └── string.h
│ ├── node.h
│ ├── node_arguments.h
│ ├── node_signature.h
│ ├── type.h
│ ├── type_registry.h
│ └── version.h
├── jni
├── Android.mk
├── Application.mk
├── android_config.mk
└── find_fplutil.mk
├── module_library
├── include
│ └── module_library
│ │ ├── animation.h
│ │ ├── audio.h
│ │ ├── default_graph_factory.h
│ │ ├── default_graph_factory.inc
│ │ ├── entity.h
│ │ ├── physics.h
│ │ ├── rendermesh.h
│ │ ├── transform.h
│ │ └── vec.h
├── jni
│ ├── Android.mk
│ ├── Application.mk
│ └── android_config.mk
├── schemas
│ ├── common_modules.fbs
│ ├── corgi_module.fbs
│ ├── mathfu_module.fbs
│ └── pindrop_module.fbs
└── src
│ ├── animation.cpp
│ ├── audio.cpp
│ ├── entity.cpp
│ ├── physics.cpp
│ ├── rendermesh.cpp
│ ├── transform.cpp
│ └── vec.cpp
├── samples
├── CMakeLists.txt
├── README_BUILDING.txt
└── event_counter
│ ├── AndroidManifest.xml
│ ├── CMakeLists.txt
│ ├── event_counter.cpp
│ ├── jni
│ ├── Android.mk
│ └── Application.mk
│ └── res
│ └── values
│ └── strings.xml
└── src
├── breadboard
├── event.cpp
├── graph.cpp
├── graph_factory.cpp
├── graph_state.cpp
├── log.cpp
├── module.cpp
├── module_registry.cpp
├── node.cpp
├── node_arguments.cpp
├── node_signature.cpp
├── type_registry.cpp
└── version.cpp
└── modules
├── common.cpp
├── debug.cpp
├── logic.cpp
├── math.cpp
└── string.cpp
/.gitignore:
--------------------------------------------------------------------------------
1 | CMakeCache.txt
2 | CMakeFiles/
3 | Makefile
4 | assets/
5 | bin/
6 | cmake_install.cmake
7 | gen/
8 | module_library/gen/
9 | obj/
10 | docs/html/
11 | docs/linklint_results/
12 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "dependencies/vectorial"]
2 | path = dependencies/vectorial
3 | url = http://github.com/scoopr/vectorial.git
4 | [submodule "dependencies/mathfu"]
5 | path = dependencies/mathfu
6 | url = http://github.com/google/mathfu.git
7 | [submodule "dependencies/cardboard-java"]
8 | path = dependencies/cardboard-java
9 | url = https://github.com/googlesamples/cardboard-java
10 | [submodule "dependencies/motive"]
11 | path = dependencies/motive
12 | url = http://github.com/google/motive.git
13 | [submodule "dependencies/libvorbis"]
14 | path = dependencies/libvorbis
15 | url = https://git.xiph.org/mirrors/vorbis.git
16 | [submodule "dependencies/bulletphysics"]
17 | path = dependencies/bulletphysics
18 | url = http://github.com/bulletphysics/bullet3.git
19 | [submodule "dependencies/pindrop"]
20 | path = dependencies/pindrop
21 | url = http://github.com/google/pindrop.git
22 | [submodule "dependencies/sdl"]
23 | path = dependencies/sdl
24 | url = http://github.com/google/fplbase.git
25 | [submodule "dependencies/webp"]
26 | path = dependencies/webp
27 | url = https://chromium.googlesource.com/webm/libwebp
28 | [submodule "dependencies/corgi"]
29 | path = dependencies/corgi
30 | url = http://github.com/google/corgi.git
31 | [submodule "dependencies/libogg"]
32 | path = dependencies/libogg
33 | url = https://git.xiph.org/mirrors/ogg.git
34 | [submodule "dependencies/fplbase"]
35 | path = dependencies/fplbase
36 | url = http://github.com/google/fplbase.git
37 | [submodule "dependencies/sdl_mixer"]
38 | path = dependencies/sdl_mixer
39 | url = http://github.com/google/pindrop.git
40 | [submodule "dependencies/fplutil"]
41 | path = dependencies/fplutil
42 | url = http://github.com/google/fplutil.git
43 | [submodule "dependencies/flatbuffers"]
44 | path = dependencies/flatbuffers
45 | url = http://github.com/google/flatbuffers.git
46 | [submodule "dependencies/googletest"]
47 | path = dependencies/googletest
48 | url = http://github.com/google/googletest.git
49 | [submodule "dependencies/stb"]
50 | path = dependencies/stb
51 | url = https://github.com/nothings/stb.git
52 |
--------------------------------------------------------------------------------
/CONTRIBUTING:
--------------------------------------------------------------------------------
1 | Contributing {#contributing}
2 | ============
3 |
4 | Want to contribute? Great! First, read this page (including the small print at
5 | the end).
6 |
7 | ### Before you contribute
8 |
9 | Before we can use your code, you must sign the
10 | [Google Individual Contributor License Agreement](https://developers.google.com/open-source/cla/individual?csw=1)
11 | (CLA), which you can do online. The CLA is necessary mainly because you own the
12 | copyright to your changes, even after your contribution becomes part of our
13 | codebase, so we need your permission to use and distribute your code. We also
14 | need to be sure of various other things—for instance that you'll tell us if you
15 | know that your code infringes on other people's patents. You don't have to sign
16 | the CLA until after you've submitted your code for review and a member has
17 | approved it, but you must do it before we can put your code into our codebase.
18 | Before you start working on a larger contribution, you should get in touch with
19 | us first through the issue tracker with your idea so that we can help out and
20 | possibly guide you. Coordinating up front makes it much easier to avoid
21 | frustration later on.
22 |
23 | ### Code reviews
24 |
25 | All submissions, including submissions by project members, require review. We
26 | use Github pull requests for this purpose.
27 |
28 | ### The small print
29 |
30 | Contributions made by corporations are covered by a different agreement than
31 | the one above, the Software Grant and Corporate Contributor License Agreement.
32 |
--------------------------------------------------------------------------------
/README:
--------------------------------------------------------------------------------
1 | README.md
2 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Breadboard {#breadboard_readme}
2 | ==========
3 |
4 | ## Overview
5 |
6 | The Breadboard scripting library is a graph based scripting system designed with
7 | games in mind. Complex behvaiors for game entities can be organized by
8 | interlinking nodes representing game actions.
9 |
10 | ## Features
11 |
12 | * Graph based scripting: Set up complex game behaviors without needing to use
13 | code. Just arrange nodes in a graph and connect them together.
14 | * Extensible: Breadboard can be extended with user-defined Nodes that interact
15 | with your game
16 | * Cross-platform: Breadboard can be incorperated in to projects on all major
17 | platforms.
18 |
19 | ## Dependencies
20 |
21 | Breadboard depends on the following library:
22 |
23 | * [fplutil][]
24 |
25 | fplutil provides a number of useful utilities. Breadboard makes use of
26 | `fplutil::intrusive_list` internally to build lists to track various structures
27 | without doing unnecessary allocations.
28 |
29 | Additionally, Breadboard ships with some example Modules. These additional
30 | modules in the `module_library` folder depend on the following libraries:
31 |
32 | * [Bullet Physics][]
33 | * [CORGI][]
34 | * [Flatbuffers][]
35 | * [MathFu][]
36 | * [Pindrop][]
37 |
38 | These libraries are all optional and can be conditionally compiled based on
39 | your needs. See the options at the top of the root level CMakeLists.txt to see
40 | how to configure the module library to include just what you need.
41 |
42 | ## Notes
43 |
44 | For applications on Google Play that integrate this tool, usage is tracked.
45 | This tracking is done automatically using the embedded version string (see
46 | `src/breadboard/version.cpp`), and helps us continue to optimize it. Aside from
47 | consuming a few extra bytes in your application binary, it shouldn't affect your
48 | application at all. We use this information to let us know if Pindrop is useful
49 | and if we should continue to invest in it. Since this is open source, you are
50 | free to remove the version string but we would appreciate if you would leave it
51 | in.
52 |
53 | [Bullet Physics]: http://bulletphysics.org/
54 | [CORGI]: http://google.github.io/corgi/
55 | [fplutil]: http://google.github.io/fplutil/
56 | [FlatBuffers]: http://google.github.io/flatbuffers/
57 | [MathFu]: http://google.github.io/mathfu/
58 | [Pindrop]: http://google.github.io/pindrop/
59 |
--------------------------------------------------------------------------------
/cmake/find_fplutil.cmake:
--------------------------------------------------------------------------------
1 | # Find the fplutil directory and set it in `fplutil_dir`.
2 | #
3 | # We search some standard locations, such as
4 | # (1) the cached variable ${dependencies_fplutil_dir}, which can be specified
5 | # on the command line,
6 | # cmake -Ddependencies_fplutil_dir=your_fplutil_directory
7 | # (2) under ${fpl_root}, which is another cached variable that can be
8 | # specified on the command line,
9 | # cmake -Dfpl_root=your_fpl_root_directory
10 | # (3) the "dependencies" directory that gets created when cloning from GitHub,
11 | # (4) several levels up in the directory tree.
12 | #
13 | # Notes
14 | # -----
15 | # - fplutil is the project where we keep all our shared code, so the code in
16 | # this file (which locates fplutil) can unfortunately not be shared.
17 | # - Since this file is duplicated in all FPL projects (except fplutil itself),
18 | # please copy new versions to all FPL projects whenever you make a change.
19 |
20 | set(fplutil_dir_possibilities
21 | "${dependencies_fplutil_dir}"
22 | "${fpl_root}/fplutil"
23 | "${CMAKE_CURRENT_SOURCE_DIR}/dependencies/fplutil"
24 | "${CMAKE_CURRENT_LIST_DIR}/../../fplutil"
25 | "${CMAKE_CURRENT_LIST_DIR}/../../../fplutil"
26 | "${CMAKE_CURRENT_LIST_DIR}/../../../../fplutil"
27 | "${CMAKE_CURRENT_LIST_DIR}/../../../../../fplutil")
28 |
29 | foreach(dir ${fplutil_dir_possibilities})
30 | if(EXISTS ${dir})
31 | set(fplutil_dir ${dir})
32 | return()
33 | endif()
34 | endforeach(dir)
35 |
36 | # Define this cached variable so that cmake GUIs can expose it to the user.
37 | set(dependencies_fplutil_dir ""
38 | CACHE PATH "Directory containing the fplutil library.")
39 |
40 | MESSAGE(ERROR
41 | "Can't find fplutil directory. Try cmake -Ddependencies_fplutil_dir=your_location.")
42 |
--------------------------------------------------------------------------------
/disttools/config.json:
--------------------------------------------------------------------------------
1 | {
2 | "package": {
3 | "name": "breadboard",
4 | "url": "http://github.com/google/breadboard.git",
5 | "branch": "develop",
6 | "is_library": 1,
7 | "third_party": 0,
8 | "push": 1
9 | },
10 | "dependencies": [
11 | {
12 | "name": "fplutil",
13 | "url": "http://github.com/google/fplutil.git",
14 | "branch": "develop",
15 | "is_library": 1,
16 | "third_party": 0,
17 | "push": 0
18 | },
19 | {
20 | "name": "flatbuffers",
21 | "url": "http://github.com/google/flatbuffers.git",
22 | "branch": "master",
23 | "is_library": 1,
24 | "third_party": 0,
25 | "push": 0
26 | },
27 | {
28 | "name": "mathfu",
29 | "url": "http://github.com/google/mathfu.git",
30 | "branch": "develop",
31 | "is_library": 1,
32 | "third_party": 0,
33 | "push": 0,
34 | "fetch_dependencies": 1
35 | },
36 | {
37 | "name": "motive",
38 | "url": "http://github.com/google/motive.git",
39 | "branch": "develop",
40 | "is_library": 1,
41 | "third_party": 0,
42 | "push": 0,
43 | "fetch_dependencies": 1
44 | },
45 | {
46 | "name": "fplbase",
47 | "url": "http://github.com/google/fplbase.git",
48 | "branch": "develop",
49 | "is_library": 1,
50 | "third_party": 0,
51 | "push": 0,
52 | "fetch_dependencies": 1
53 | },
54 | {
55 | "name": "pindrop",
56 | "url": "http://github.com/google/pindrop.git",
57 | "branch": "develop",
58 | "is_library": 1,
59 | "third_party": 0,
60 | "push": 0,
61 | "fetch_dependencies": 1
62 | },
63 | {
64 | "name": "corgi",
65 | "url": "http://github.com/google/corgi.git",
66 | "branch": "develop",
67 | "is_library": 1,
68 | "third_party": 0,
69 | "push": 0,
70 | "fetch_dependencies": 1
71 | },
72 | {
73 | "name": "bulletphysics",
74 | "url": "http://github.com/bulletphysics/bullet3.git",
75 | "branch": "master",
76 | "revision": "30ebb322285809bde98959e10e73e5acb9981efc",
77 | "is_library": 1,
78 | "third_party": 1,
79 | "push": 0
80 | }
81 | ]
82 | }
83 |
--------------------------------------------------------------------------------
/disttools/push_package.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # Copyright 2015 Google Inc. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """Push this project and its dependencies to another git repo.
17 |
18 | Uses fplutil/disttools/push_package.py to push the remote of
19 | this git repository and its dependencies (defined by config.json)
20 | to another git repository.
21 | """
22 |
23 | import os
24 | import sys
25 | sys.path.extend((
26 | os.path.realpath(os.path.join(
27 | os.path.dirname(__file__), os.path.pardir, 'dependencies', 'fplutil')),
28 | os.path.realpath(os.path.join(
29 | os.path.dirname(__file__), os.path.pardir, os.path.pardir,
30 | 'fplutil'))))
31 | import disttools.push_package # pylint: disable=g-import-not-at-top
32 |
33 | ## The directory containing this file.
34 | THIS_DIR = os.path.realpath(os.path.dirname(__file__))
35 |
36 | ## Default root directory of the project.
37 | PROJECT_DIR = os.path.realpath(os.path.join(THIS_DIR, os.path.pardir))
38 |
39 | ## Default package configuration file.
40 | CONFIG_JSON = os.path.realpath(os.path.join(THIS_DIR, 'config.json'))
41 |
42 |
43 | def main():
44 | """See fplutil/disttools/push_package.py.
45 |
46 | Returns:
47 | 0 if successful, non-zero otherwise.
48 | """
49 | return disttools.push_package.main(disttools.push_package.parse_arguments(
50 | project_dir=PROJECT_DIR, config_json=CONFIG_JSON))
51 |
52 |
53 | if __name__ == '__main__':
54 | sys.exit(main())
55 |
--------------------------------------------------------------------------------
/docs/generate_docs.py:
--------------------------------------------------------------------------------
1 | #!/usr/bin/python
2 | # Copyright 2014 Google Inc. All Rights Reserved.
3 | #
4 | # Licensed under the Apache License, Version 2.0 (the "License");
5 | # you may not use this file except in compliance with the License.
6 | # You may obtain a copy of the License at
7 | #
8 | # http://www.apache.org/licenses/LICENSE-2.0
9 | #
10 | # Unless required by applicable law or agreed to in writing, software
11 | # distributed under the License is distributed on an "AS IS" BASIS,
12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 | # See the License for the specific language governing permissions and
14 | # limitations under the License.
15 |
16 | """Generate html documentation from markdown and doxygen comments."""
17 |
18 | import os
19 | import sys
20 |
21 | THIS_DIR = os.path.realpath(os.path.dirname(__file__))
22 | PROJECT_DIR = os.path.realpath(os.path.join(THIS_DIR, os.pardir))
23 | sys.path.extend(
24 | [os.path.realpath(os.path.join(PROJECT_DIR, os.pardir, 'fplutil')),
25 | os.path.realpath(os.path.join(PROJECT_DIR, 'dependencies', 'fplutil'))])
26 | import docs # pylint: disable=C6204
27 |
28 |
29 | def main():
30 | """Generate html documentation from markdown and doxygen comments.
31 |
32 | Returns:
33 | 0 if successful, 1 otherwise.
34 | """
35 | sys.argv.extend(('--linklint-dir', THIS_DIR,
36 | '--source-dir', os.path.join(THIS_DIR, 'src'),
37 | '--project-dir', PROJECT_DIR))
38 | return docs.generate_docs.main()
39 |
40 | if __name__ == '__main__':
41 | sys.exit(main())
42 |
--------------------------------------------------------------------------------
/docs/src/api_reference.md:
--------------------------------------------------------------------------------
1 | API Reference {#breadboard_api_reference}
2 | =============
3 |
4 | This document describes all classes, functions, macros and files that make
5 | up the [Breadboard][] library. This is intended to be used as a reference for
6 | C++ programmers who have made themselves familiar with the
7 | [Programmer's Guide][].
8 |
9 | [Breadboard]: @ref breadboard_index
10 | [Programmer's Guide]: @ref breadboard_guide_overview
11 |
--------------------------------------------------------------------------------
/docs/src/contributing.md:
--------------------------------------------------------------------------------
1 | ../../CONTRIBUTING
--------------------------------------------------------------------------------
/docs/src/doxygen_layout.xml:
--------------------------------------------------------------------------------
1 |
15 |
16 |
17 |
18 |
20 |
21 |
23 |
24 |
25 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
212 |
213 |
214 |
215 |
216 |
217 |
218 |
219 |
220 |
221 |
222 |
223 |
--------------------------------------------------------------------------------
/docs/src/groups:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/google/breadboard/45537cea0d6cdee70ed91d86cc6114465c351325/docs/src/groups
--------------------------------------------------------------------------------
/docs/src/index.md:
--------------------------------------------------------------------------------
1 | Breadboard {#breadboard_index}
2 | ==========
3 |
4 | [Breadboard][] is a scripting system designed to be easy to use for both
5 | programmers and game designers. Once a library of nodes has been defined, anyone
6 | can take those nodes and connect them together to form more complex behaviors
7 | for their game.
8 |
9 | ## Features
10 |
11 | * Graph based scripting: Set up complex game behaviors without needing to use
12 | code. Just arrange nodes in a graph and connect them together.
13 | * Extensible: Breadboard can be extended with user-defined Nodes that interact
14 | with your game
15 | * Cross-platform: Breadboard can be incoperated in to projects on all major
16 | platforms.
17 |
18 | ## Dependencies
19 |
20 | Breadboard depends on the following libraries:
21 |
22 | * [FPLUtil][]
23 |
24 | Additionally, Breadboard ships with some example Modules. These additional
25 | modules in the `module_library` folder depend on the following libraries:
26 |
27 | * [Bullet Physics][]
28 | * [CORGI][]
29 | * [Flatbuffers][]
30 | * [Mathfu][]
31 | * [Pindrop][]
32 |
33 | ## Download
34 |
35 | [Breadboard][] can be downloaded from:
36 |
37 | * [GitHub][] (source)
38 | * [GitHub Releases Page][] (source)
39 |
40 | **Important**: Breadboard uses submodules to reference other components it
41 | depends upon, so download the source from [GitHub][] using:
42 |
43 | ~~~{.sh}
44 | git clone --recursive https://github.com/google/breadboard.git
45 | ~~~
46 |
47 | ## Feedback and Reporting Bugs
48 |
49 | * Discuss Breadboard with other developers and users on the
50 | [Breadboard Google Group][].
51 | * File issues on the [Breadboard Issues Tracker][].
52 | * Post your questions to [stackoverflow.com][] with a mention of
53 | **fpl breadboard**.
54 |
55 |
56 |
57 | [Breadboard]: http://github.com/google/breadboard
58 | [Breadboard Google Group]: http://groups.google.com/group/breadboard-scripting
59 | [Breadboard Issues Tracker]: http://github.com/google/breadboard/issues
60 | [Bullet Physics]: http://bulletphysics.org/
61 | [CORGI]: http://google.github.io/corgi/
62 | [FPLUtil]: http://google.github.io/fplutil/
63 | [FlatBuffers]: http://google.github.io/flatbuffers/
64 | [GitHub Releases Page]: http://github.com/google/breadboard/releases
65 | [GitHub]: http://github.com/google/breadboard
66 | [Mathfu]: http://google.github.io/mathfu/
67 | [Pindrop]: http://google.github.io/pindrop/
68 | [stackoverflow.com]: http://stackoverflow.com/search?q=fpl+breadboard
69 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/building/building.md:
--------------------------------------------------------------------------------
1 | Building {#breadboard_guide_building}
2 | ========
3 |
4 | Developers can build the library from source for [Android][], [Linux][],
5 | [OS X][] and [Windows][].
6 |
7 | * [Building for Android][]
8 | * [Building for Linux][]
9 | * [Building for OS X][]
10 | * [Building for Windows][]
11 |
12 |
13 |
14 | [Android]: http://www.android.com
15 | [Building for Android]: @ref breadboard_guide_building_android
16 | [Building for Linux]: @ref breadboard_guide_building_linux
17 | [Building for OS X]: @ref breadboard_guide_building_osx
18 | [Building for Windows]: @ref breadboard_guide_building_windows
19 | [Linux]: http://en.m.wikipedia.org/wiki/Linux
20 | [OS X]: http://www.apple.com/osx/
21 | [Windows]: http://windows.microsoft.com/
22 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/building/building_android.md:
--------------------------------------------------------------------------------
1 | Building for Android {#breadboard_guide_building_android}
2 | ====================
3 |
4 | ## Version Requirements
5 |
6 | Following are the minimum tested versions for the tools and libraries you
7 | need for building [Breadboard][] for Android:
8 |
9 | * [Android SDK][]: Android 4.1 (API Level 16)
10 | * [ADT][]: 20140702
11 | * [Android NDK][]: android-ndk-r10e
12 | * [cmake][]: 2.8.12 or newer
13 | * [Python][]: 2.7.x
14 |
15 | ## Before Building
16 |
17 | * Install prerequisites for the developer machine's operating system.
18 | * [Linux prerequisites](@ref building_linux_prerequisites)
19 | * [OS X prerequisites](@ref building_osx_prerequisites)
20 | * [Windows prerequisites](@ref building_windows_prerequisites)
21 | * Install [fplutil prerequisites][]
22 | * Install the [Android SDK][].
23 | * Install the [Android NDK][].
24 |
25 | ## Building
26 |
27 | To include [Breadboard][] in your project you will need to make the following
28 | changes to your Android.mk
29 |
30 | * Ensure that the variable `DEPENDENCIES_BREADBOARD_DIR` is defined and points
31 | to the directory containing the Breadboard library.
32 | * Add `libbreadboard` to your list of `LOCAL_STATIC_LIBRARIES`
33 | * Run `$(call import-add-path,$(DEPENDENCIES_BREADBOARD_DIR)/..)` near the end
34 | of Android.mk, after you call `include $(BUILD_SHARED_LIBRARY)`
35 | * Lastly, run `$(call import-module,breadboard/jni)`
36 |
37 | Your project should now build and link against Breadboard.
38 |
39 |
40 |
41 | [ADT]: http://developer.android.com/tools/sdk/eclipse-adt.html
42 | [Android NDK]: http://developer.android.com/tools/sdk/ndk/index.html
43 | [Android SDK]: http://developer.android.com/sdk/index.html
44 | [cmake]: http://www.cmake.org/
45 | [fplutil prerequisites]: http://google.github.io/fplutil/fplutil_prerequisites.html
46 | [fplutil]: http://google.github.io/fplutil
47 | [Breadboard]: @ref breadboard_guide_overview
48 | [Python]: http://www.python.org/download/releases/2.7/
49 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/building/building_linux.md:
--------------------------------------------------------------------------------
1 | Building for Linux {#breadboard_guide_building_linux}
2 | ==================
3 |
4 | ## Version Requirements
5 |
6 | Following are the minimum required versions for the tools and libraries you
7 | need for building [Breadboard][] for Linux:
8 |
9 | * [cmake][]: 2.8.12 or newer
10 | * [Python][]: 2.7.x
11 |
12 | ## Before Building {#building_linux_prerequisites}
13 |
14 | Prior to building, install the following components using the [Linux][]
15 | distribution's package manager:
16 |
17 | * [cmake][]: You can also manually install from [cmake.org](http://cmake.org).
18 | * [Python][]: 2.7.x
19 |
20 | For example, on Ubuntu:
21 |
22 | sudo apt-get install cmake python
23 |
24 | ## Building
25 |
26 | When building Breadboard, you can either build the library as part of another
27 | project, or you can build it as a stand-alone library. To simply build the
28 | library (and the sample project) do the following:
29 |
30 | * Generate makefiles from the [cmake][] project in the `breadboard` directory.
31 | * Execute `make` to build the library and sample.
32 |
33 | For example:
34 |
35 | cd breadboard
36 | cmake -G'Unix Makefiles' .
37 | make
38 |
39 | To build Breadboard from another project, add the following to your project's
40 | CMakeLists.txt:
41 |
42 | add_subdirectory("${path_to_breadboard}" breadboard)
43 | include_directories(${path_to_breadboard}/include)
44 |
45 | Additionally, if you are making use of the `module_library` packaged with
46 | [Breadboard][], you will need to include additional directories, both the
47 | `module_library`'s include folder as well as the generated include folder if you
48 | are making use of the Flatbuffer-based GraphFactory.
49 |
50 | include_directories(${path_to_breadboard}/module_library/include)
51 | get_property(BREADBOARD_MODULE_LIBRARY_FLATBUFFERS_GENERATED_INCLUDES_DIR
52 | TARGET breadboard_module_library_generated_includes
53 | PROPERTY GENERATED_INCLUDES_DIR)
54 | include_directories(${BREADBOARD_MODULE_LIBRARY_FLATBUFFERS_GENERATED_INCLUDES_DIR})
55 |
56 | Additionally, ensure that you are linking the library and it's dependencies when
57 | running `target_link_libraries`:
58 |
59 | target_link_libraries(breadboard)
60 |
61 |
62 |
63 | [Breadboard]: @ref breadboard_guide_overview
64 | [Linux]: http://en.wikipedia.org/wiki/Linux
65 | [Python]: http://www.python.org/download/releases/2.7/
66 | [cmake]: http://www.cmake.org/
67 |
68 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/building/building_osx.md:
--------------------------------------------------------------------------------
1 | Building for OS X {#breadboard_guide_building_osx}
2 | =================
3 |
4 | You can use [cmake][] to generate an [Xcode][] project for Breadboard on [OS X][].
5 |
6 | # Version Requirements
7 |
8 | These are the minimum required versions for building Breadboard on OS X:
9 |
10 | * [OS X][]: Mavericks 10.9.1.
11 | * [Xcode][]: 5.1.1 or newer
12 | * [cmake][]: 2.8.12 or newer
13 | * [Python][]: 2.7.x
14 |
15 | # Before Building {#building_osx_prerequisites}
16 |
17 | Prior to building, install the following software:
18 |
19 | * [cmake][]: You can also manually install from [cmake.org](http://cmake.org).
20 | * [Python][]: 2.7.x
21 |
22 | # Creating the Xcode project using cmake
23 |
24 | The [Xcode][] project is generated using [cmake][].
25 |
26 | For example, the following generates the [Xcode][] project in the `breadboard`
27 | directory.
28 |
29 | ~~~{.sh}
30 | cd breadboard
31 | cmake -G "Xcode"
32 | ~~~
33 |
34 | # Building with Xcode
35 |
36 | * Double-click on `breadboard/breadboard.xcodeproj` to open the project in
37 | [Xcode][].
38 | * Select "Product-->Build" from the menu.
39 |
40 | You can also build the game from the command-line.
41 |
42 | * Run `xcodebuild` after generating the Xcode project to build all targets.
43 | * You may need to force the `generated_includes` target to be built first.
44 |
45 | For example, in the breadboard directory:
46 |
47 | ~~~{.sh}
48 | xcodebuild -target generated_includes
49 | xcodebuild
50 | ~~~
51 |
52 |
53 |
54 | [cmake]: http://www.cmake.org
55 | [OS X]: http://www.apple.com/osx/
56 | [Breadboard]: @ref breadboard_guide_overview
57 | [Python]: http://www.python.org/download/releases/2.7/
58 | [Xcode]: http://developer.apple.com/xcode/
59 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/building/building_windows.md:
--------------------------------------------------------------------------------
1 | Building for Windows {#breadboard_guide_building_windows}
2 | ====================
3 |
4 | You can use [CMake][] to generate a [Visual Studio][] project for
5 | [Breadboard][] on [Windows][].
6 |
7 | # Version Requirements
8 |
9 | These are the minimum required versions for building [Breadboard][] for Windows:
10 |
11 | * [Windows][]: 7
12 | * [Visual Studio][]: 2010 or newer
13 | * [CMake][]: 2.8.12 or newer.
14 | * [Python][]: 2.7.x
15 |
16 | # Before Building {#building_windows_prerequisites}
17 |
18 | * Install [CMake][]
19 | * Install [Python][]
20 |
21 | # Creating the Visual Studio Solution using CMake
22 |
23 | Use [CMake][] to generate the [Visual Studio][] solution and project files.
24 |
25 | The following example generates the [Visual Studio][] 2010 solution in the
26 | `breadboard` directory:
27 |
28 | cd breadboard
29 | cmake -G "Visual Studio 10"
30 |
31 | # Building with Visual Studio
32 |
33 | * Double-click on `breadboard/breadboard.sln` to open the solution.
34 | * Select "Build-->Build Solution" from the menu.
35 |
36 | It's also possible to build from the command line using msbuild after using
37 | vsvars32.bat to setup the [Visual Studio][] build environment. For example,
38 | assuming [Visual Studio][] is installed in
39 | `c:\Program Files (x86)\Microsoft Visual Studio 10.0`.
40 |
41 | cd breadboard
42 | "c:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\vsvars32.bat"
43 | cmake -G "Visual Studio 10"
44 | msbuild breadboard.sln
45 |
46 |
47 |
48 | [CMake]: http://www.cmake.org
49 | [Breadboard]: @ref breadboard_guide_overview
50 | [Python]: http://www.python.org/download/releases/2.7/
51 | [Visual Studio]: http://www.visualstudio.com/
52 | [Windows]: http://windows.microsoft.com/
53 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/howto/events.md:
--------------------------------------------------------------------------------
1 | Events {#breadboard_guide_events}
2 | ======
3 |
4 | ## Overview
5 |
6 | Events are what drive Graph execution. Most nodes will have some set of inputs
7 | and outputs, but without getting updates from the game state that exists outside
8 | the graph, the graph nodes will never execute.
9 |
10 | To broadcast events to nodes in a graph, two structures are needed, a
11 | NodeEventListener and a NodeEventBroadcaster.
12 |
13 | ## NodeEventBroadcaster
14 |
15 | A NodeEventBroadcaster is an object that can be included on any game object that
16 | makes sense for your game. They can exist on world objects, players, entities,
17 | or anything else. Typically a specific Broadcaster will be associated with the
18 | object that holds it. That way you can do things like have an event that
19 | triggers when your entity collides with something. In that case, you would
20 | broadcast a collision event from the broadcaster which that specific entity
21 | owns. That event would then be broadcast to only the graphs that are listening
22 | to that broadcaster.
23 |
24 | A broadcaster can be registered to any number of listeners, and can broadcast
25 | any kind of event.
26 |
27 | Events may be broadcast by calling
28 | `NodeEventBroadcaster::BroadcastEvent(event_id)`.
29 |
30 | ## NodeEventListener
31 |
32 | NodeEventListeners exist on the Node and are not instantiated directly. Instead,
33 | during the OnRegistration step, as many listeners as needed may be added to your
34 | node. For example:
35 |
36 | ~~~{.cpp}
37 | // ...
38 | static void OnRegister(NodeSignature* signature) {
39 | signature->AddInput();
40 | signature->AddListener(kCollisionEventId);
41 | }
42 | virtual void Initialize(NodeArguments* args) {
43 | GameActor* actor = args->GetInput(0);
44 | args->BindBroadcaster(0, actor->broadcaster);
45 | }
46 | // ...
47 | ~~~
48 |
49 | In this example this node registers a single NodeEventListener that is listening
50 | for the event kCollisionEventId. During initialization, the actor associated
51 | with this node has it's broadcaster bound to that listener. Now any time that
52 | the actor fires a kCollisionEventId, this node will be marked dirty and have its
53 | Execute function (not shown here) called.
54 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/howto/graphs.md:
--------------------------------------------------------------------------------
1 | Graphs {#breadboard_guide_graphs}
2 | ======
3 |
4 | ## Overview
5 |
6 | Graphs are split up into two main classes, the Graph and GraphState. The Graph
7 | class defines the set of nodes that make up the Graph, as well as the
8 | connections between them and any default values. You can think of the Graph as
9 | the immutable definition of the set of behavior. The GraphState is a stateful
10 | object backed by a Graph. You can have any number of instances of GraphStates
11 | that all point at the same Graph. This is useful for when you have, for example,
12 | many duplicates of the same kind of actor in your game.
13 |
14 | ### Limitations
15 |
16 | In the initial release of Breadboard, Graphs are implemented such that they may
17 | not contain cycles. That is, if node A has an input edge pointing at node B,
18 | then node B can not have an input edge pointing at node A. This restriction may
19 | be lifted in a future update.
20 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/howto/modules.md:
--------------------------------------------------------------------------------
1 | Modules {#breadboard_guide_modules}
2 | =======
3 |
4 | ## Overview
5 |
6 | Modules are collections of related nodes. Modules exist primarily as a
7 | convenient way to organize nodes and also help avoid name collisions.
8 |
9 | ## Creating a Module
10 |
11 | Modules are created by calling `ModuleRegistry::RegisterModule(name)`. Once a
12 | module is registered, any number of nodes may be added to it.
13 |
14 | A number of examples can be seen in the `src/modules` directory. Here is a
15 | typical example of the process of registering a Module as well as the nodes that
16 | go with it:
17 |
18 | ~~~{.cpp}
19 | void InitializeStringModule(ModuleRegistry* module_registry) {
20 | Module* module = module_registry->RegisterModule("string");
21 | module->RegisterNode("equals");
22 | module->RegisterNode("int_to_string");
23 | module->RegisterNode("float_to_string");
24 | module->RegisterNode("concat");
25 | }
26 | ~~~
27 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/howto/nodes.md:
--------------------------------------------------------------------------------
1 | Nodes {#breadboard_guide_nodes}
2 | =====
3 |
4 | ## Overview
5 |
6 | Nodes are the basic building blocks of a graph. Most nodes define an `Execute`
7 | function in C++ code which can take any number of arguments, process them, and
8 | then provide any number of outputs which other nodes may then consume.
9 |
10 | ## Basic Example
11 |
12 | As a simple example, see `src/modules/string.cpp`. This file defines the node
13 | ConcatNode, shown below:
14 |
15 | ~~~{.cpp}
16 | // Concatenates the given strings.
17 | class ConcatNode : public BaseNode {
18 | public:
19 | virtual ~ConcatNode() {}
20 |
21 | static void OnRegister(NodeSignature* node_sig) {
22 | node_sig->AddInput();
23 | node_sig->AddInput();
24 | node_sig->AddOutput();
25 | }
26 |
27 | virtual void Execute(NodeArguments* args) {
28 | auto str_a = args->GetInput(0);
29 | auto str_b = args->GetInput(1);
30 | args->SetOutput(0, *str_a + *str_b);
31 | }
32 | };
33 | ~~~
34 |
35 | When this node is registered with Breadboard, it's OnRegister function is run.
36 | OnRegister is given a NodeSignature object that is used to define the number of
37 | inputs and outputs to this node. In this example, two `std::string` inputs and a
38 | single string output are declared.
39 |
40 | Execute is where the behavior for this node is run. In this example, our node
41 | takes its two inputs by calling `args->GetInput(index);`. This
42 | function returns the value in the input edge by pointer. When writing nodes you
43 | must take care to match the expected return type for the given edge index with
44 | the signature defined in OnRegister or else the call to `GetInput` will assert.
45 |
46 | Finally, the result of the operation (in this case, concatenating two strings)
47 | is passed to `args->SetOutput`. In this case there is only a single output, so
48 | we pass 0 as the first argument, but if there were additional outputs we might
49 | also pass values to other indexes as well. As with input edges, make sure that
50 | the type being passed in matches the type declared in the NodeSignature in
51 | OnRegister.
52 |
53 | In some cases you don't need to pass data around but you still want to trigger
54 | execution of a node. This can be achieved by assigning inputs or outputs
55 | with the type `void`. Rather than getting a pointer to the value using
56 | `args->GetInput(index)`, you would simply call `args->IsInputDirty(index)`
57 | (Note: This function can be used on input edges of any type). For output edges
58 | that are declared void, simple call `args->SetOutput(index)` without a value
59 | argument to mark it as dirty.
60 |
61 | ## Node Inputs
62 |
63 | Node inputs can be specified in two ways: Either by pointing at the output of
64 | some other node, or by supplying a default value.
65 |
66 | ## Node Execution
67 |
68 | Nodes have three main functions declared on BaseNode. You will always need to
69 | implement OnRegister to define your node's interface. You may additionally
70 | override the `Initialize` and `Execute` functions. Without implementing at least
71 | one of these functions, your node will do nothing.
72 |
73 | Nodes execute if one of two conditions is met.
74 |
75 | * The node has a NodeEventListener associated with it, and an event that the
76 | node is listening for has been broadcast.
77 | * As a result of another executing, one of the input edges on this node has
78 | been updated.
79 |
80 | Any time an input edge of a node is changed as the result of a call to SetOutput
81 | it is considered dirty, and will have its Evaluate function called.
82 |
83 | ## BaseNode interface
84 |
85 | ### OnRegister
86 |
87 | OnRegister is a static method, but it must be defined for your type. You do not
88 | technically override it, but you must still supply a copy of this function.
89 | OnRegister is called automatically when your node is registered with a Module.
90 |
91 | ### Initialize
92 |
93 | Initialize is called once when the GraphState itself is initialized. This can be
94 | a useful place to do any special set up for your node, or to set the value of
95 | output edges that only need to be set once and will never change. Initialize
96 | recieves a NodeArguments structure containing the default values for the inputs.
97 | You may set outputs as well from Initialize, but during the initialization step
98 | nodes that depend on those outputs are not marked as dirty.
99 |
100 | ### Execute
101 |
102 | Execute is where most of the heavy lifting will be done. This would be where you
103 | implement most behaviors. Using the NodeArguments structure you can get any
104 | values your node needs to operate and perform actions such as updating UI,
105 | playing audio, printing debug logs to the console, or responding to phsyics
106 | events. Nodes can be set up for just about any type of behavior that would want
107 | to script.
108 |
109 | ## Node Registration
110 |
111 | To register a node so that it can be used by Breadboard, simply call
112 | `Module::RegisterNode(name)`. You must specify a node name that is
113 | unique to this module.
114 |
115 | By default, when constructing nodes the default constructor is used. However,
116 | this is not always ideal (or possible). In these cases, you may additionally
117 | provide custom constructor and destuctor callbacks.
118 |
119 | For example, if you are writing a PlaySound node that requires a pointer to the
120 | audio engine, you could write it like this:
121 |
122 | ~~~{.cpp}
123 | class PlaySoundNode : public BaseNode {
124 | public:
125 | PlaySoundNode(AudioEngine* audio_engine) : audio_engine_(audio_engine) {}
126 | // ...
127 |
128 | private:
129 | AudioEngine* audio_engine_;
130 | };
131 |
132 | // ...
133 |
134 | void InitializeAudioModule(ModuleRegistry* module_registry,
135 | AudioEngine* audio_engine) {
136 | Module* module = module_registry->RegisterModule("audio");
137 | // Custom constructor for PlaySoundNode since it cannot be constructed
138 | // with the default constructor.
139 | auto play_sound_ctor = [audio_engine]() {
140 | return new PlaySoundNode(audio_engine);
141 | };
142 | module->RegisterNode("play_sound", play_sound_ctor);
143 | }
144 | ~~~
145 |
--------------------------------------------------------------------------------
/docs/src/programmers_guide/overview.md:
--------------------------------------------------------------------------------
1 | Overview {#breadboard_guide_overview}
2 | ========
3 |
4 | ## Downloading
5 |
6 | [Breadboard][] can be downloaded from [GitHub][] or the [Releases Page][].
7 |
8 | ~~~{.sh}
9 | git clone --recursive https://github.com/google/breadboard.git
10 | ~~~
11 |
12 | ## Important Concepts
13 |
14 | The Breadboard API contains the following important concepts:
15 | * [Nodes][] - Individual bits of logic or behavior that can be activated.
16 | * [Modules][] - Collections of related nodes.
17 | * [Graphs][] - An arrangement of nodes to form more complex behaviors.
18 | * [Events][] - How graph actions are triggered.
19 |
20 | ## Source Layout
21 |
22 | The following bullets describe the directory structure of the library.
23 |
24 | | Path | Description |
25 | |-------------------------------|----------------------------------------------|
26 | | `breadboard` base directory | Project build files and run script. |
27 | | `jni` | The android makefile for the library. |
28 | | `samples` | Sample projects to demonstrate usage. |
29 | | `src/breadboard` | The library's souce code. |
30 | | `src/modules` | The source code for the default modules. |
31 | | `module_library` | Additional modules using external libraries. |
32 |
33 |
34 |
35 | [Breadboard]: @ref breadboard_guide_overview
36 | [Events]: @ref breadboard_guide_events
37 | [GitHub]: http://github.com/google/breadboard
38 | [Graphs]: @ref breadboard_guide_graphs
39 | [Modules]: @ref breadboard_guide_modules
40 | [Nodes]: @ref breadboard_guide_nodes
41 | [Releases Page]: http://github.com/google/breadboard/releases
42 |
--------------------------------------------------------------------------------
/include/breadboard/base_node.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef BREADBOARD_BASE_NODE_H_
16 | #define BREADBOARD_BASE_NODE_H_
17 |
18 | #include
19 |
20 | #include "breadboard/event.h"
21 | #include "breadboard/node_arguments.h"
22 | #include "breadboard/node_signature.h"
23 |
24 | /// @file breadboard/base_node.h
25 | ///
26 | /// @brief A BaseNode is the common class that all nodes that are to be used in
27 | /// a graph must extend.
28 |
29 | namespace breadboard {
30 |
31 | /// @class BaseNode
32 | ///
33 | /// @brief A BaseNode is the common class that all nodes that are to be used in
34 | /// a graph must extend.
35 | ///
36 | /// Each class that implements BaseNode must be registered in a Module before it
37 | /// may be used in a graph.
38 | ///
39 | /// Nodes are the primary method of performing actions in Breadboard. Nodes can
40 | /// take any number of input edge parameters and perform actions based on those
41 | /// parameters. They in turn provide various output arguments which may be
42 | /// consumed by other nodes. The connnections between nodes can be used to
43 | /// script complex behavior.
44 | class BaseNode {
45 | public:
46 | /// @brief Destructor for a BaseNode.
47 | virtual ~BaseNode() {}
48 |
49 | /// @brief When this node is registered, the input edges, output edges and
50 | /// active listeners for this node are defined by this function.
51 | ///
52 | /// Although this is a static function, all classes inheriting from BaseNode
53 | /// must implement an OnRegister function. This function is used to define the
54 | /// inputs, outputs, and listeners that this node requires.
55 | ///
56 | /// @param[in,out] signature An object that represents the input edge
57 | /// parameters, output edge parameters, and active
58 | /// listeners for this kind of node.
59 | static void OnRegister(NodeSignature* signature) {
60 | (void)signature;
61 | assert(false); // This function should be implemented in the derived class
62 | }
63 |
64 | /// @brief Initialize is called once upon when an instance of a GraphState is
65 | /// initiazlized. This function can be used to set output edge arguments that
66 | /// are guaranteed to never change or do other one-time setup.
67 | ///
68 | /// Initialize is called once when a GraphState object is being initialized.
69 | /// You can use this to do any special set up. For example, if this is a node
70 | /// that has no inputs and only outputs that are unchanging, you can set them
71 | /// once here and not need to worry about doing anything in Execute. This is
72 | /// also a useful place to bind listeners with broadcasters.
73 | virtual void Initialize(NodeArguments* args) { (void)args; }
74 |
75 | /// @brief Execute is called any time the node is marked dirty in the graph.
76 | ///
77 | /// Execute is called any time this node in the graph is marked dirty. This
78 | /// can happen in two ways. One way is that this node has a listener that has
79 | /// had an event broadcast to it. The other is that another node updated an
80 | /// output edge that this node is observing.
81 | ///
82 | /// This function is where the bulk of the interesting logic should occur in a
83 | /// node.
84 | virtual void Execute(NodeArguments* args) { (void)args; }
85 | };
86 |
87 | } // namespace breadboard
88 |
89 | #endif // BREADBOARD_BASE_NODE_H_
90 |
--------------------------------------------------------------------------------
/include/breadboard/event.h:
--------------------------------------------------------------------------------
1 | // Copyright 2015 Google Inc. All rights reserved.
2 | //
3 | // Licensed under the Apache License, Version 2.0 (the "License");
4 | // you may not use this file except in compliance with the License.
5 | // You may obtain a copy of the License at
6 | //
7 | // http://www.apache.org/licenses/LICENSE-2.0
8 | //
9 | // Unless required by applicable law or agreed to in writing, software
10 | // distributed under the License is distributed on an "AS IS" BASIS,
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 | // See the License for the specific language governing permissions and
13 | // limitations under the License.
14 |
15 | #ifndef BREADBOARD_EVENT_H_
16 | #define BREADBOARD_EVENT_H_
17 |
18 | #include