1 /*
2 
3   Copyright (C) 2011 Grame
4 
5   This library is free software; you can redistribute it and/or
6   modify it under the terms of the GNU Lesser General Public
7   License as published by the Free Software Foundation; either
8   version 2.1 of the License, or (at your option) any later version.
9 
10   This library is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13   Lesser General Public License for more details.
14 
15   You should have received a copy of the GNU Lesser General Public
16   License along with this library; if not, write to the Free Software
17   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
18 
19   Grame Research Laboratory, 9 rue du Garet, 69001 Lyon - France
20   research@grame.fr
21 
22 */
23 
24 
25 #ifndef __RootNode__
26 #define __RootNode__
27 
28 #include <string>
29 #include "MessageDriven.h"
30 
31 namespace httpdfaust
32 {
33 
34 class RootNode;
35 typedef class SMARTP<RootNode>	SRootNode;
36 
37 //--------------------------------------------------------------------------
38 /*!
39 	\brief a faust program root node
40 */
41 class RootNode : public MessageDriven
42 {
43 	std::string fJson;
44 	std::string fHtml;
45 
46 	protected:
RootNode(const char * name)47 				 RootNode(const char *name) : MessageDriven (name, "") {}
~RootNode()48 		virtual ~RootNode() {}
49 
50 	public:
create(const char * name)51 		static SRootNode create(const char* name) { return new RootNode(name); }
52 
setJSON(const std::string & json)53 		void			setJSON(const std::string& json)	{ fJson = json; }
setHtml(const std::string & html)54 		void			setHtml(const std::string& html)	{ fHtml = html; }
55 		//--------------------------------------------------------------------------
56 		bool			processMessage(const Message* msg, std::vector<Message*>& outMsg);
57 		virtual bool	accept(const Message* msg, std::vector<Message*>& outMsg);
58 };
59 
60 } // end namespoace
61 
62 #endif
63