INGOR
Loading...
Searching...
No Matches
ytNode.h
1/*
2 net/ytNode.{h,c} : Node in networks
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_NODE_H
10#define __YTLIB_NODE_H
11
12#include "lang/ytObject.h"
13#include "util/ytKeyValues.h"
14
15typedef struct {
16 ytObject obj;
17 char * name;
18 ytKeyValues * prop;
19} ytNode;
20
21ytNode * ytNode_new();
22void ytNode_delete(ytNode * this);
23ytNode * ytNode_newName(const char * name);
24ytNode * ytNode_clone(const ytNode * this);
25void ytNode_dump(ytNode * this, FILE * fp);
26void ytNode_setName(ytNode * this, const char * name);
27const char * ytNode_getName(const ytNode * this);
28ytObject * ytNode_obj(ytNode * this);
29ytNode * ytNode_from(ytObject * obj);
30size_t ytNode_numProperties(const ytNode * this);
31void ytNode_addProperty(ytNode * this, const char * key, ytObject * value);
32void ytNode_setProperty(ytNode * this, const char * key, ytObject * value);
33void ytNode_setPropertyInt(ytNode * this, const char * key, int value);
34void ytNode_setPropertyDouble(ytNode * this, const char * key, double value);
35void ytNode_setPropertyString(ytNode * this, const char * key, const char * value);
36ytObject * ytNode_getProperty(const ytNode * this, const char * key);
37ytObject * ytNode_getPropertyAt(ytNode * this, size_t i);
38int ytNode_getPropertyInt(ytNode * this, const char * key, int defValue);
39const char * ytNode_getPropertyString(const ytNode * this, const char * key);
40ytStrArray * ytNode_getPropertyKeys(ytNode * this, ytStrArray * ar);
41const char * ytNode_getPropertyKey(const ytNode * this, size_t i);
42ytType ytNode_getPropertyType(const ytNode * this, size_t i );
43
44size_t ytNode_size(const ytNode * this);
45ytByte * ytNode_serialize(const ytNode * this, ytByte ** pptr);
46ytNode * ytNode_deserialize(ytByte ** const pptr);
47size_t ytNode_sizeI(const ytObject * obj);
48ytByte * ytNode_serializeI(const ytObject * obj, ytByte ** pptr);
49ytObject * ytNode_deserializeI(ytByte ** const pptr);
50
51#ifndef DOXY
52int ytNode_test(int argc, char * argv[]);
53#endif /* DOXY */
54
55#endif /* __YTLIB_NODE_H */
key-value pairs.
The basis class.
Expandable array.
ytType
Types supported by ytLib.
Definition ytType.h:14
Network node.
Definition ytNode.h:15