INGOR
Loading...
Searching...
No Matches
ytObject.h
1/*
2 lang/ytObject.{h,c} : Object abstraction
3 Copyright (C) 2018, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions
8 are met:
9
10 * Redistributions of source code must retain the above copyright
11 notice, this list of conditions and the following disclaimer.
12
13 * Redistributions in binary form must reproduce the above copyright
14 notice, this list of conditions and the following disclaimer in
15 the documentation and/or other materials provided with the
16 distribution.
17
18 * Neither the name of Kyoto University nor the names of its
19 contributors may be used to endorse or promote products derived
20 from this software without specific prior written permission.
21
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26 COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32 ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 POSSIBILITY OF SUCH DAMAGE.
34*/
35
36#include "ytType.h"
37
38#ifndef __YTLIB_OBJECT_H
39#define __YTLIB_OBJECT_H
40
41
42#ifndef DOXY
43typedef struct ytObject_t {
44 ytType type;
45} ytObject;
46#endif
47ytType ytObject_type(const ytObject * this);
48ytObject * ytObject_new(ytType type);
49void ytObject_delete(ytObject * this);
50void ytObject_deletev(void * this);
51ytObject * ytObject_clone(const ytObject * this);
52ytObject * ytObject_parse(ytType type, const char * str);
53void ytObject_print(const ytObject * this, FILE * fp);
54int ytObject_sprint(const ytObject * this, char * buff, size_t size);
55void ytObject_printBuff(const ytObject * this, char ** buff, size_t * size);
56ytObject * ytObject_copy(const ytObject * this);
57int ytObject_compare(const ytObject * a, const ytObject * b);
58void ytObject_dump(const ytObject * this, FILE * fp);
59size_t ytObject_size(const ytObject * this);
60ytByte * ytObject_serialize(const ytObject * this, ytByte ** ptr);
61ytObject * ytObject_deserialize(ytByte ** const ptr);
62#ifdef USE_MPI
63#include <mpi.h>
64void ytObject_MPI_Bcast(ytObject ** pObject, int root, MPI_Comm comm);
65#endif /* USE_MPI */
66#endif /* __YTLIB_OBJECT_H */
The basis class.
ytType
Types supported by ytLib.
Definition ytType.h:41