Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 75 lines (59 sloc) 2.04 kB
4b71bbe @mhroth Add LGPL license to remaining files.
authored
1 /*
90f89e6 @mhroth Allow unpack to handle "anything".
authored
2 * Copyright 2009,2010 Reality Jockey, Ltd.
4b71bbe @mhroth Add LGPL license to remaining files.
authored
3 * info@rjdj.me
4 * http://rjdj.me/
5 *
6 * This file is part of ZenGarden.
7 *
8 * ZenGarden is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * ZenGarden is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public License
19 * along with ZenGarden. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
abb33ec First commit of current source.
Martin Roth authored
23 #ifndef _PD_MESSAGE_ELEMENT_H_
24 #define _PD_MESSAGE_ELEMENT_H_
25
c29ea7e @mhroth Convert PdGraph to subclass of DspObject. Remove PdNode.h. Constructo…
authored
26 #include <string.h>
abb33ec First commit of current source.
Martin Roth authored
27 #include "MessageElementType.h"
28
66e787d @mhroth A more memory efficient implemention of MessageElement such that the …
authored
29 #define SYMBOL_BUFFER_LENGTH 56
30
90f89e6 @mhroth Allow unpack to handle "anything".
authored
31 /** Implements a Pd message element. */
abb33ec First commit of current source.
Martin Roth authored
32 class MessageElement {
33
34 public:
35 MessageElement();
36 MessageElement(float newConstant);
37 MessageElement(char *newSymbol);
38 ~MessageElement();
39
40 MessageElementType getType();
cdc919a @mhroth Add type checking convenience functions to MessageElement (e.g., isFl…
authored
41 bool isFloat();
42 bool isSymbol();
43 bool isBang();
fbf7f65 @mhroth First attempt at comprehensive argument resolution (e.g. $1).
authored
44 bool isSymbolAnythingOrA();
45 bool isSymbolBangOrB();
46 bool isSymbolFloatOrF();
47 bool isSymbolListOrL();
90f89e6 @mhroth Allow unpack to handle "anything".
authored
48 bool isSymbolSymbolOrS();
abb33ec First commit of current source.
Martin Roth authored
49
50 void setFloat(float constant);
51 float getFloat();
52
53 void setSymbol(char *symbol);
54 char *getSymbol();
55
56 void setBang();
57
fbf7f65 @mhroth First attempt at comprehensive argument resolution (e.g. $1).
authored
58 /** Sets the type of this element to ANYTHING. What that means is otherwise undefined. */
59 void setAnything();
60
61 /** Sets the type of this element to LIST. What that means is otherwise undefined. */
62 void setList();
63
abb33ec First commit of current source.
Martin Roth authored
64 MessageElement *copy();
65
66 bool equals(MessageElement *messageElement);
67
68 private:
69 MessageElementType currentType;
66e787d @mhroth A more memory efficient implemention of MessageElement such that the …
authored
70 float constant;
71 char symbol[SYMBOL_BUFFER_LENGTH];
abb33ec First commit of current source.
Martin Roth authored
72 };
73
74 #endif // _PD_MESSAGE_ELEMENT_H_
Something went wrong with that request. Please try again.