Debian Codegraph @

dwsys/DataStore.cpp

raw
1 /* DataStore.cpp
2 *
3 * Copyright (C) 2023 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 #include "DataStore.h"
20
21 Thing_implement (StoredData, Daata, 0);
22 Thing_implement (StoredDataList, Ordered, 0);
23
24 autoStoredData StoredData_create (Daata data, conststring32 description) {
25 try {
26 autoStoredData me = Thing_new (StoredData);
27 autoDaata datacopy = Data_copy (data);
28 my data = datacopy.move();
29 my description = SimpleString_create (description);
30 return me;
31 } catch (MelderError) {
32 Melder_throw (U"Cannot create StoredData with description '", description, U"'.");
33 }
34 }
35
36 /* End of file DataStore.cpp */