libIntegra
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
command.h
Go to the documentation of this file.
1 /* libIntegra modular audio framework
2  *
3  * Copyright (C) 2007 Birmingham City University
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * This program 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
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
18  * USA.
19  */
20 
35 #ifndef COMMAND_API_H
36 #define COMMAND_API_H
37 
38 #include "common_typedefs.h"
39 #include "error.h"
40 
41 
42 namespace integra_internal
43 {
44  class CServer;
45 }
46 
47 
48 namespace integra_api
49 {
50  class CPath;
51  class CValue;
52  class CCommandResult;
53  class CCommandSource;
54 
61  class INTEGRA_API ICommand
62  {
63  protected:
64  ICommand() {}
65  public:
66 
67  virtual ~ICommand() {}
68 
70  virtual CError execute( integra_internal::CServer &server, CCommandSource source, CCommandResult *result ) = 0;
71  };
72 
73 
77  class INTEGRA_API INewCommand : public ICommand
78  {
79  protected:
80  INewCommand() {}
81  public:
82  virtual ~INewCommand() {}
83 
91  static INewCommand *create( const GUID &module_id, const string &node_name, const CPath &parent_path );
92  };
93 
94 
98  class INTEGRA_API IDeleteCommand : public ICommand
99  {
100  protected:
101  IDeleteCommand() {}
102  public:
103  virtual ~IDeleteCommand() {}
104 
110  static IDeleteCommand *create( const CPath &path );
111  };
112 
113 
117  class INTEGRA_API ISetCommand : public ICommand
118  {
119  protected:
120  ISetCommand() {}
121  public:
122  virtual ~ISetCommand() {}
123 
130  static ISetCommand *create( const CPath &endpoint_path, const CValue &value );
131 
137  static ISetCommand *create( const CPath &endpoint_path );
138 
139  virtual const CPath &get_endpoint_path() const = 0;
140  };
141 
142 
146  class INTEGRA_API IRenameCommand : public ICommand
147  {
148  protected:
149  IRenameCommand() {}
150  public:
151  virtual ~IRenameCommand() {}
152 
158  static IRenameCommand *create( const CPath &path, const string &new_name );
159  };
160 
161 
165  class INTEGRA_API IMoveCommand : public ICommand
166  {
167  protected:
168  IMoveCommand() {}
169  public:
170  virtual ~IMoveCommand() {}
171 
179  static IMoveCommand *create( const CPath &node_path, const CPath &new_parent_path );
180  };
181 
182 
186  class INTEGRA_API ILoadCommand : public ICommand
187  {
188  protected:
189  ILoadCommand() {}
190  public:
191  virtual ~ILoadCommand() {}
192 
199  static ILoadCommand *create( const string &file_path, const CPath &parent_path );
200  };
201 
202 
206  class INTEGRA_API ISaveCommand : public ICommand
207  {
208  protected:
209  ISaveCommand() {}
210  public:
211  virtual ~ISaveCommand() {}
212 
219  static ISaveCommand *create( const string &file_path, const CPath &node_path );
220  };
221 }
222 
223 
224 #endif
Command to add new nodes to the node hierarchy.
Definition: command.h:77
Base class for the concrete value classes CIntegerValue, CFloatValue and CStringValue.
Definition: value.h:42
Command to save node hierarchies, associated data files and embedded modules to .integra files...
Definition: command.h:206
Defines class CError.
Definition: common_typedefs.h:45
Command to delete nodes from the node hierarchy.
Definition: command.h:98
Command to load node hierarchies, associated data files and embedded modules from ...
Definition: command.h:186
Command to rename nodes.
Definition: command.h:146
Represents an enumeration of error codes.
Definition: error.h:40
Command to set 'control' type node endpoints.
Definition: command.h:117
Command to move nodes to different branches of the node hierarchy.
Definition: command.h:165
Represents an enumeration of command sources.
Definition: command_source.h:39
Base class for all libIntegra commands.
Definition: command.h:61
Base class for all command result classes.
Definition: command_result.h:50
Represents the address of a node endpoint, absolutely or relatively.
Definition: path.h:48
#defines and typedefs used throughout the application