BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
ElogPerson.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2// ElogPerson header file
3// Generated 27-11-2017
4// ----------------------------------------------------------------------
5
6/** ElogPerson.h
7 ** Class for the table: person_
8 **/
9
10#ifndef ElogPerson_H
11#define ElogPerson_H 1
12
13#include "ElogConnection.h"
14#include "TDatime.h"
15#include "TObjArray.h"
16#include "TString.h"
17
19{
20 private:
21 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
22 /// connection to the database
24
25 /// person id
27 /// person name
29 /// is active
31 /// email
33
34 // Constructor
35 ElogPerson(ElogConnection* db_connect, TString person_id, TString person_name, bool is_active, TString* email);
36 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
37
38 public:
39 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
40 virtual ~ElogPerson(); // Destructor
41
42 // static class functions
43 /// add new person to the database
44 static ElogPerson* CreatePerson(TString person_name, bool is_active, TString* email);
45 /// get person from the database
46 static ElogPerson* GetPerson(TString person_id);
47 /// check person exists in the database: 1 - true, 0 - false, <0 - database operation error
48 static int CheckPersonExists(TString person_id);
49 /// delete person from the database
50 static int DeletePerson(TString person_id);
51 /// print all persons
52 static int PrintAll();
53
54 // Getters
55 /// get person id of the current person
57 /// get person name of the current person
59 /// get is active of the current person
60 bool GetIsActive() { return b_is_active; }
61 /// get email of the current person
63 {
64 if (str_email == nullptr)
65 return nullptr;
66 else
67 return new TString(*str_email);
68 }
69
70 // Setters
71 /// set person name of the current person
72 int SetPersonName(TString person_name);
73 /// set is active of the current person
74 int SetIsActive(bool is_active);
75 /// set email of the current person
76 int SetEmail(TString* email);
77
78 /// print information about current person
79 void Print();
80 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
81
82 /// get persons from the database by name or its part
83 static TObjArray* GetPersonByName(TString person_name_part);
84 /// check persons exists in the database by name or its part:
85 /// >=1 - person count, 0 - false, <0 - database operation error
86 static int CheckPersonExistsByName(TString person_name_part);
87 /// delete persons from the database by name or its part
88 /// >=1 - affected count, 0 - persons not found, <0 - database operation error
89 static int DeletePersonByName(TString person_name_part);
90
92};
93
94#endif
#define ClassDef(name, id)
ElogPerson.h Class for the table: person_.
Definition ElogPerson.h:19
TString GetPersonName()
get person name of the current person
Definition ElogPerson.h:58
static int CheckPersonExistsByName(TString person_name_part)
check persons exists in the database by name or its part: >=1 - person count, 0 - false,...
bool b_is_active
is active
Definition ElogPerson.h:30
int SetIsActive(bool is_active)
set is active of the current person
TString * GetEmail()
get email of the current person
Definition ElogPerson.h:62
static ElogPerson * CreatePerson(TString person_name, bool is_active, TString *email)
add new person to the database
static int PrintAll()
print all persons
static int DeletePersonByName(TString person_name_part)
delete persons from the database by name or its part >=1 - affected count, 0 - persons not found,...
bool GetIsActive()
get is active of the current person
Definition ElogPerson.h:60
static TObjArray * GetPersonByName(TString person_name_part)
get persons from the database by name or its part
TString * str_email
email
Definition ElogPerson.h:32
static ElogPerson * GetPerson(TString person_id)
get person from the database
void Print()
print information about current person
TString GetPersonId()
get person id of the current person
Definition ElogPerson.h:56
int SetEmail(TString *email)
set email of the current person
virtual ~ElogPerson()
ElogConnection * connectionDB
connection to the database
Definition ElogPerson.h:23
int SetPersonName(TString person_name)
set person name of the current person
static int CheckPersonExists(TString person_id)
check person exists in the database: 1 - true, 0 - false, <0 - database operation error
static int DeletePerson(TString person_id)
delete person from the database
TString str_person_name
person name
Definition ElogPerson.h:28
ElogPerson(ElogConnection *db_connect, TString person_id, TString person_name, bool is_active, TString *email)
TString str_person_id
person id
Definition ElogPerson.h:26