diff options
author | mike <mike@d8baa203-390c-0410-a584-dba4c0749223> | 2011-07-16 18:53:45 +0000 |
---|---|---|
committer | mike <mike@d8baa203-390c-0410-a584-dba4c0749223> | 2011-07-16 18:53:45 +0000 |
commit | 3005ed13f0fde6d61ab8a229c1490f9389cd75b5 (patch) | |
tree | 737c067dc4ceb0e4cee26e3e5f60ef91f8e71cdb /src/container.h | |
parent | 6bf9a32cf42b3f1a6dad7018d1b1925cc909b585 (diff) | |
download | libneural-3005ed13f0fde6d61ab8a229c1490f9389cd75b5.tar.gz libneural-3005ed13f0fde6d61ab8a229c1490f9389cd75b5.tar.bz2 libneural-3005ed13f0fde6d61ab8a229c1490f9389cd75b5.tar.xz libneural-3005ed13f0fde6d61ab8a229c1490f9389cd75b5.zip |
Everything is in place except for columns, networks, and a cute language for
describing the networks. ...and tests, don't forget about tests.
git-svn-id: http://svn.xagasoft.com/misc/libneural/trunk@470 d8baa203-390c-0410-a584-dba4c0749223
Diffstat (limited to '')
-rw-r--r-- | src/container.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/src/container.h b/src/container.h new file mode 100644 index 0000000..d9eeffd --- /dev/null +++ b/src/container.h | |||
@@ -0,0 +1,46 @@ | |||
1 | #ifndef NEURAL_CONTAINER_H | ||
2 | #define NEURAL_CONTAINER_H | ||
3 | |||
4 | #include "neural/node.h" | ||
5 | #include <bu/list.h> | ||
6 | |||
7 | namespace Neural | ||
8 | { | ||
9 | template<typename sigtype> | ||
10 | class Container : public Node<sigtype> | ||
11 | { | ||
12 | public: | ||
13 | typedef Bu::List<Neural::Node<sigtype> *> NodeList; | ||
14 | |||
15 | Container() | ||
16 | { | ||
17 | } | ||
18 | |||
19 | virtual ~Container() | ||
20 | { | ||
21 | for( typename NodeList::iterator i = lNodes.begin(); i; i++ ) | ||
22 | delete *i; | ||
23 | } | ||
24 | |||
25 | virtual void addNode( Node<sigtype> *pNode ) | ||
26 | { | ||
27 | lNodes.append( pNode ); | ||
28 | } | ||
29 | |||
30 | virtual const NodeList &getNodeList() const | ||
31 | { | ||
32 | return lNodes; | ||
33 | } | ||
34 | |||
35 | protected: | ||
36 | virtual NodeList &getNodeList() | ||
37 | { | ||
38 | return lNodes; | ||
39 | } | ||
40 | |||
41 | private: | ||
42 | NodeList lNodes; | ||
43 | }; | ||
44 | }; | ||
45 | |||
46 | #endif | ||