Last change
on this file since 1310 was
792,
checked in by Maciej Komosinski, 6 years ago
|
Code formatting
|
-
Property svn:eol-style set to
native
|
File size:
983 bytes
|
Rev | Line | |
---|
[286] | 1 | // This file is a part of Framsticks SDK. http://www.framsticks.com/ |
---|
| 2 | // Copyright (C) 1999-2015 Maciej Komosinski and Szymon Ulatowski. |
---|
| 3 | // See LICENSE.txt for details. |
---|
[109] | 4 | |
---|
| 5 | #ifndef _PARAMTABOBJ_H_ |
---|
| 6 | #define _PARAMTABOBJ_H_ |
---|
| 7 | |
---|
| 8 | #include "param.h" |
---|
| 9 | |
---|
| 10 | class ParamTab |
---|
| 11 | { |
---|
[792] | 12 | ParamEntry *tab; |
---|
| 13 | int siz; |
---|
| 14 | void init() { siz = 0; tab = (ParamEntry*)calloc(sizeof(ParamEntry), 1); } |
---|
| 15 | void resize(int s); |
---|
| 16 | int measureTab(const ParamEntry *pe); |
---|
[109] | 17 | |
---|
[792] | 18 | public: |
---|
| 19 | ParamTab(const ParamEntry* pe = 0, int maxcount = -1) { init(); if (pe) add(pe, maxcount); } |
---|
| 20 | ParamTab(const ParamTab& src) { init(); add(src); } |
---|
| 21 | ~ParamTab() { clear(); } |
---|
[109] | 22 | |
---|
[792] | 23 | int size() const { return siz; } |
---|
| 24 | ParamEntry* getParamTab() const { return tab; } |
---|
| 25 | ParamEntry* operator()() const { return tab; } |
---|
[109] | 26 | |
---|
[792] | 27 | /** @return position of the last added entry */ |
---|
| 28 | int add(const ParamEntry*, int count = 1); |
---|
| 29 | int add(const ParamTab& src) { return add(src.getParamTab(), src.size()); } |
---|
| 30 | void remove(int i, int count = 1); |
---|
| 31 | void clear() { resize(-1); } |
---|
[109] | 32 | }; |
---|
| 33 | |
---|
| 34 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.