BOSS 8.0.0
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
2// 06:12:26 maqm Exp $
3/** @file test_meta.cxx
4 Sample program to add record(s) to the MySQL database. For now user
5 only gets to specify
6 instrument type
7 location of file
8 validity start and end times
9
10 Ultimately need something more flexible and easier to use.
11
12*/
13
14#include "calibUtil/Metadata.h"
15#include <iostream>
16#include <string>
17
18void gotIt( unsigned int ser, const std::string& dataFmt, const std::string& fmtVersion,
19 const std::string& dataIdent );
20
21int main( int, char** ) {
24
25 Metadata meta( "*", "*", "calib_test" );
26
27 int ser = meta.registerCalib(
28 "kazoo", "mango", "Test_Gen", "notAFile.xml", "XML", facilities::Timestamp( "1990-1-5" ),
29 facilities::Timestamp( "2037-1-1" ), "",
30 "From add_meta test program in calibUtil package", "TEST", "SLAC", "", "OK", "", "" );
31 if ( ser )
32 {
33 std::cout << "Successfully added metadata record; returned serial no. is " << ser
34 << std::endl;
35 }
36 else std::cout << "Failed to register new metadata record" << std::endl;
37
38 ser = meta.registerCalib(
39 "kazoo", "mango", "Test_Gen", "alsoNotAFile.xml", "XML",
40 facilities::Timestamp( "1990-2-5" ), facilities::Timestamp( "2037-1-1" ), "",
41 "From add_meta test program in calibUtil package, overlaps previous", "TEST", "SLAC", "",
42 "OK", "", "" );
43 if ( ser )
44 {
45 std::cout << "Successfully added metadata record; returned serial no. is " << ser
46 << 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}
double meta
void gotIt(unsigned int ser, const std::string &dataFmt, const std::string &fmtVersion, const std::string &dataIdent)
Definition test_meta.cxx:91
int main()
Definition phokhara.cc:42