Libmacro  0.2
Libmacro is an extensible macro and hotkey library.
instance.h
Go to the documentation of this file.
1 /* Libmacro - A multi-platform, extendable macro and hotkey C library
2  Copyright (C) 2013 Jonathan Pelletier, New Paradigm Software
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18 
27 #ifndef MCR_BASE_INSTANCE_H_
28 #define MCR_BASE_INSTANCE_H_
29 
30 #include "mcr/base/interface.h"
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
37 struct mcr_Instance {
42 };
43 
48 MCR_API void mcr_Instance_init(struct mcr_Instance *instancePt);
49 
56 MCR_API void mcr_Instance_deinit(struct mcr_Instance *instancePt);
57 
64 MCR_API size_t mcr_Instance_id(struct mcr_Instance *instancePt);
65 
71 static MCR_INLINE void *mcr_Instance_data(struct mcr_Instance *instancePt)
72 {
73  return instancePt ? instancePt->data_member.data : NULL;
74 }
75 
81 MCR_API bool mcr_Instance_heap(struct mcr_Instance *instancePt);
82 
90 MCR_API int mcr_Instance_set_interface(struct mcr_Instance *instancePt,
91  struct mcr_Interface *interfacePt);
98 MCR_API int mcr_Instance_clear(struct mcr_Instance *instancePt);
105 MCR_API int mcr_Instance_reset(struct mcr_Instance *instancePt);
113 MCR_API int mcr_Instance_compare(const struct mcr_Instance *lhsPt,
114  const struct mcr_Instance *rhsPt);
122 MCR_API int mcr_Instance_copy(struct mcr_Instance *dstPt,
123  const struct mcr_Instance *srcPt);
124 
125 #ifdef __cplusplus
126 }
127 #endif
128 
129 #endif
MCR_API void mcr_Instance_init(struct mcr_Instance *instancePt)
MCR_API size_t mcr_Instance_id(struct mcr_Instance *instancePt)
MCR_API int mcr_Instance_copy(struct mcr_Instance *dstPt, const struct mcr_Instance *srcPt)
MCR_API int mcr_Instance_set_interface(struct mcr_Instance *instancePt, struct mcr_Interface *interfacePt)
MCR_API int mcr_Instance_reset(struct mcr_Instance *instancePt)
mcr_Interface
MCR_API int mcr_Instance_compare(const struct mcr_Instance *lhsPt, const struct mcr_Instance *rhsPt)
MCR_API bool mcr_Instance_heap(struct mcr_Instance *instancePt)
struct mcr_Interface * interface
Definition: instance.h:39
struct mcr_DataMember data_member
Definition: instance.h:41
MCR_API int mcr_Instance_clear(struct mcr_Instance *instancePt)
MCR_API void mcr_Instance_deinit(struct mcr_Instance *instancePt)