source: cpp/frams/param/paramobj.h @ 197

Last change on this file since 197 was 197, checked in by Maciej Komosinski, 7 years ago

GDK used by developers since 1999, distributed on the web since 2002

  • Property svn:eol-style set to native
File size: 1.6 KB
Line 
1// This file is a part of the Framsticks GDK.
2// Copyright (C) 1999-2014  Maciej Komosinski and Szymon Ulatowski.  See LICENSE.txt for details.
3// Refer to http://www.framsticks.com/ for further information.
4
5#ifndef _PARAMOBJ_H_
6#define _PARAMOBJ_H_
7
8#include "param.h"
9
10class ParamObject
11{
12  public:
13/** make a ParamEntry* array for use with Param object.
14    offsets in the array are calculated for the ExtObject array as the target.
15    valid array can be created with makeObject().
16    sample code:
17    @code
18    ParamInterface *pi=...; // any param interface
19    ParamEntry *tab=ParamObject::makeParamTab(pi);
20    void* obj=ParamObject::makeObject(tab);
21    void* obj2=ParamObject::makeObject(tab);
22    Param par(tab,obj);
23    par.set(...), par.get(...), par.load(...), par.save(...);
24    par.select(obj);
25    par.select(obj2);
26    ParamObject::freeObject(obj);
27    ParamObject::freeObject(obj2);
28 */
29static ParamEntry* makeParamTab(ParamInterface *pi,bool stripgroups=0,bool stripproc=0,int firstprop=0,int maxprops=9999,bool dupentries=false, int flagsexclude=0);
30
31/** deallocate paramtab obtained from makeParamTab() */
32static void freeParamTab(ParamEntry *pe);
33
34static bool paramTabEqual(ParamEntry *pe1,ParamEntry *pe2);
35
36/** @return the object, suitable for Param.select(...).
37    @return NULL if 'pi' has no usable properties */
38static void* makeObject(ParamEntry *tab);
39
40/** copy data from src to dst  */
41static void copyObject(void* dst,void* src);
42
43/** duplicate object */
44static void* dupObject(void* obj);
45
46/** delete all data in the array and deallocate it  */
47static void freeObject(void* obj);
48};
49
50#endif
Note: See TracBrowser for help on using the repository browser.