BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
add_meta.cxx
Go to the documentation of this file.
1// $Header: /bes/bes/BossCvs/Calibration/calibUtil/src/test/add_meta.cxx,v 1.1.1.1 2005/10/17 06:12:26 maqm Exp $
2/** @file test_meta.cxx
3 Sample program to add record(s) to the MySQL database. For now user
4 only gets to specify
5 instrument type
6 location of file
7 validity start and end times
8
9 Ultimately need something more flexible and easier to use.
10
11*/
12
13#include <string>
14#include <iostream>
15#include "calibUtil/Metadata.h"
16
17void gotIt(unsigned int ser, const std::string& dataFmt,
18 const std::string& fmtVersion, const std::string& dataIdent);
19
20int main(int, char**) {
23
24 Metadata meta("*", "*", "calib_test");
25
26 int ser =
27 meta.registerCalib("kazoo","mango", "Test_Gen", "notAFile.xml",
28 "XML", facilities::Timestamp("1990-1-5"),
29 facilities::Timestamp("2037-1-1"), "",
30 "From add_meta test program in calibUtil package",
31 "TEST", "SLAC", "", "OK", "", "");
32 if (ser) {
33 std::cout << "Successfully added metadata record; returned serial no. is "
34 << ser << std::endl;
35 }
36 else std::cout << "Failed to register new metadata record" << std::endl;
37
38 ser =
39 meta.registerCalib("kazoo","mango", "Test_Gen", "alsoNotAFile.xml",
40 "XML", facilities::Timestamp("1990-2-5"),
41 facilities::Timestamp("2037-1-1"), "",
42 "From add_meta test program in calibUtil package, overlaps previous",
43 "TEST", "SLAC", "", "OK", "", "");
44 if (ser) {
45 std::cout << "Successfully added metadata record; returned serial no. is "
46 << ser << std::endl;
47 }
48 else std::cout << "Failed to register new metadata record" << std::endl;
49
50 /*
51 ser =
52 meta.registerCalib("cello","rocky road", "Test_Gen", "notAnotherFile.root",
53 "ROOT", facilities::Timestamp("1993-1-5"),
54 facilities::Timestamp("2035-6-11"), "",
55 "From add_meta test program in calibUtil package",
56 "TEST", "SLAC", "", "OK", "", "");
57 if (ser) {
58 std::cout << "Successfully added metadata record; returned serial no. is "
59 << ser << std::endl;
60 }
61 else std::cout << "Failed to register new metadata record" << std::endl;
62
63 ser = meta.registerCalib("banjo","rocky road", "Test_Gen",
64 "notAnotherFile.xml",
65 "XML", facilities::Timestamp("1997-1-5"),
66 facilities::Timestamp("1998-6-11"), "",
67 "From add_meta test program in calibUtil package",
68 "TEST", "SLAC", "", "ILLEGAL", "", "");
69
70 if (ser) {
71 std::cout << "Successfully added metadata record; returned serial no. is "
72 << ser << std::endl;
73 }
74 else std::cout << "Failed to register new metadata record" << std::endl;
75 */
76
77}
78
79
80
double meta
void gotIt(unsigned int ser, const std::string &dataFmt, const std::string &fmtVersion, const std::string &dataIdent)
Definition: test_meta.cxx:103
int main()
Definition: test_IFile.cxx:11