libiec61850  1.2.0
mms_type_spec.h
Go to the documentation of this file.
1 /*
2  * mms_type_spec.h
3  *
4  * MmsTypeSpecfication objects are used to describe simple and complex MMS types.
5  * Complex types are arrays or structures of simple and complex types.
6  * They also represent MMS NamedVariables.
7  *
8  * Copyright 2013, 2014 Michael Zillgith
9  *
10  * This file is part of libIEC61850.
11  *
12  * libIEC61850 is free software: you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation, either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * libIEC61850 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU General Public License for more details.
21  *
22  * You should have received a copy of the GNU General Public License
23  * along with libIEC61850. If not, see <http://www.gnu.org/licenses/>.
24  *
25  * See COPYING file for the complete license text.
26  */
27 
28 #ifndef MMS_TYPE_SPEC_H_
29 #define MMS_TYPE_SPEC_H_
30 
31 #include "mms_common.h"
32 #include "mms_types.h"
33 #include "linked_list.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
54 void
55 MmsVariableSpecification_destroy(MmsVariableSpecification* self);
56 
70 MmsValue*
71 MmsVariableSpecification_getChildValue(MmsVariableSpecification* self, MmsValue* value, const char* childId);
72 
81 MmsVariableSpecification*
82 MmsVariableSpecification_getNamedVariableRecursive(MmsVariableSpecification* self, const char* nameId);
83 
91 MmsType
92 MmsVariableSpecification_getType(MmsVariableSpecification* self);
93 
102 bool
103 MmsVariableSpecification_isValueOfType(MmsVariableSpecification* self, MmsValue* value);
104 
115 const char*
116 MmsVariableSpecification_getName(MmsVariableSpecification* self);
117 
118 LinkedList /* <char*> */
119 MmsVariableSpecification_getStructureElements(MmsVariableSpecification* self);
120 
128 int
129 MmsVariableSpecification_getSize(MmsVariableSpecification* self);
130 
131 MmsVariableSpecification*
132 MmsVariableSpecification_getChildSpecificationByIndex(MmsVariableSpecification* self, int index);
133 
143 MmsVariableSpecification*
144 MmsVariableSpecification_getChildSpecificationByName(MmsVariableSpecification* self, const char* name, int* index);
145 
146 MmsVariableSpecification*
147 MmsVariableSpecification_getArrayElementSpecification(MmsVariableSpecification* self);
148 
149 int
150 MmsVariableSpecification_getExponentWidth(MmsVariableSpecification* self);
151 
156 #ifdef __cplusplus
157 }
158 #endif
159 
160 #endif /* MMS_TYPE_SPEC_H_ */
const char * MmsVariableSpecification_getName(MmsVariableSpecification *self)
get the name of the variable
MmsType MmsVariableSpecification_getType(MmsVariableSpecification *self)
get the MMS type of the variable
void MmsVariableSpecification_destroy(MmsVariableSpecification *self)
Delete MmsTypeSpecification object (recursive).
MmsVariableSpecification * MmsVariableSpecification_getArrayElementSpecification(MmsVariableSpecification *self)
LinkedList MmsVariableSpecification_getStructureElements(MmsVariableSpecification *self)
MmsVariableSpecification * MmsVariableSpecification_getChildSpecificationByIndex(MmsVariableSpecification *self, int index)
int MmsVariableSpecification_getExponentWidth(MmsVariableSpecification *self)
int MmsVariableSpecification_getSize(MmsVariableSpecification *self)
returns the number of elements if the type is a complex type (structure, array) or the bit size of in...
MmsVariableSpecification * MmsVariableSpecification_getChildSpecificationByName(MmsVariableSpecification *self, const char *name, int *index)
return the MmsVariableSpecification of a structure element with the given name
bool MmsVariableSpecification_isValueOfType(MmsVariableSpecification *self, MmsValue *value)
Check if the value has exactly the same type as this variable specfication.
MmsVariableSpecification * MmsVariableSpecification_getNamedVariableRecursive(MmsVariableSpecification *self, const char *nameId)
Get the child of self specified by its relative name.
MmsValue * MmsVariableSpecification_getChildValue(MmsVariableSpecification *self, MmsValue *value, const char *childId)
Get the corresponding child of value according to childId.
struct sMmsValue MmsValue
Definition: mms_value.h:68
MmsType
Definition: mms_common.h:105