| 1 | /* Roots_def.h |
| 2 | * |
| 3 | * Copyright (C) 2020 David Weenink |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 2 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | * General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #define ooSTRUCT Roots |
| 20 | oo_DEFINE_CLASS (Roots, Daata) |
| 21 | oo_INTEGER (numberOfRoots) |
| 22 | #if oo_READING |
| 23 | oo_VERSION_UNTIL (1) |
| 24 | // oo_INTEGER (min); already in numberOfRoots |
| 25 | integer max; |
| 26 | #if oo_READING_BINARY |
| 27 | max = bingetinteger32BE (_filePointer_); |
| 28 | #else |
| 29 | max = texgetinteger (_textSource_); |
| 30 | #endif |
| 31 | numberOfRoots = max - numberOfRoots + 1; |
| 32 | oo_COMPVEC (roots, numberOfRoots) |
| 33 | oo_VERSION_ELSE |
| 34 | oo_COMPVEC (roots, numberOfRoots) |
| 35 | oo_VERSION_END |
| 36 | #else |
| 37 | oo_COMPVEC (roots, numberOfRoots) |
| 38 | #endif |
| 39 | |
| 40 | #if oo_DECLARING |
| 41 | void v1_info () |
| 42 | override; |
| 43 | void resize (integer newNumberOfRoots) { |
| 44 | roots.resize (newNumberOfRoots); |
| 45 | numberOfRoots = newNumberOfRoots; |
| 46 | } |
| 47 | #endif |
| 48 | |
| 49 | oo_END_CLASS (Roots) |
| 50 | #undef ooSTRUCT |
| 51 | |
| 52 | /* End of file Roots_def.h */ |