BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
ElogContact.h
Go to the documentation of this file.
1// ----------------------------------------------------------------------
2// ElogContact header file
3// Generated 13-04-2026
4// ----------------------------------------------------------------------
5
6/** /home/gertsen/bmnroot/database/elog_db/ElogContact.h
7 ** Class for the table: contact_
8 **/
9
10#ifndef ELOGCONTACT_H
11#define ELOGCONTACT_H 1
12
13#include "ElogConnection.h"
14#include "TDatime.h"
15#include "TString.h"
16#include "TTimeStamp.h"
17
19{
20 private:
21 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
22 /// connection to the database
24
25 /// contact id
27 /// contact name
29 /// contact desc
31 /// phones
33 /// email
35
36 // Constructor
37 ElogContact(ElogConnection* db_connect,
38 int contact_id,
39 TString* contact_name,
40 TString contact_desc,
41 TString* phones,
42 TString* email);
43 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
44
45 public:
46 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
47 virtual ~ElogContact(); // Destructor
48
49 // static class functions
50 /// add new contact to the database
51 static ElogContact* CreateContact(TString* contact_name, TString contact_desc, TString* phones, TString* email);
52 /// get contact from the database
53 static ElogContact* GetContact(int contact_id);
54 /// check contact exists in the database: 1- true, 0 - false, <0 - database operation error
55 static int CheckContactExists(int contact_id);
56 /// delete contact from the database
57 static int DeleteContact(int contact_id);
58 /// print all contacts
59 static int PrintAll();
60
61 // Getters
62 /// get contact id of the current contact
63 int GetContactId() { return i_contact_id; }
64 /// get contact name of the current contact
66 {
67 if (str_contact_name == nullptr)
68 return nullptr;
69 else
70 return new TString(*str_contact_name);
71 }
72 /// get contact desc of the current contact
74 /// get phones of the current contact
76 {
77 if (str_phones == nullptr)
78 return nullptr;
79 else
80 return new TString(*str_phones);
81 }
82 /// get email of the current contact
84 {
85 if (str_email == nullptr)
86 return nullptr;
87 else
88 return new TString(*str_email);
89 }
90
91 // Setters
92 /// set contact name of the current contact
93 int SetContactName(TString* contact_name);
94 /// set contact desc of the current contact
95 int SetContactDesc(TString contact_desc);
96 /// set phones of the current contact
97 int SetPhones(TString* phones);
98 /// set email of the current contact
99 int SetEmail(TString* email);
100
101 /// print information about current contact
102 void Print();
103 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
104
106};
107
108#endif
#define ClassDef(name, id)
/home/gertsen/bmnroot/database/elog_db/ElogContact.h Class for the table: contact_
Definition ElogContact.h:19
ElogContact(ElogConnection *db_connect, int contact_id, TString *contact_name, TString contact_desc, TString *phones, TString *email)
int SetContactName(TString *contact_name)
set contact name of the current contact
static int PrintAll()
print all contacts
TString * str_contact_name
contact name
Definition ElogContact.h:28
TString * GetContactName()
get contact name of the current contact
Definition ElogContact.h:65
TString * GetPhones()
get phones of the current contact
Definition ElogContact.h:75
static ElogContact * CreateContact(TString *contact_name, TString contact_desc, TString *phones, TString *email)
add new contact to the database
TString * str_email
email
Definition ElogContact.h:34
TString str_contact_desc
contact desc
Definition ElogContact.h:30
static ElogContact * GetContact(int contact_id)
get contact from the database
int SetPhones(TString *phones)
set phones of the current contact
int SetContactDesc(TString contact_desc)
set contact desc of the current contact
TString GetContactDesc()
get contact desc of the current contact
Definition ElogContact.h:73
int SetEmail(TString *email)
set email of the current contact
static int CheckContactExists(int contact_id)
check contact exists in the database: 1- true, 0 - false, <0 - database operation error
static int DeleteContact(int contact_id)
delete contact from the database
int GetContactId()
get contact id of the current contact
Definition ElogContact.h:63
void Print()
print information about current contact
ElogConnection * connectionDB
connection to the database
Definition ElogContact.h:23
TString * GetEmail()
get email of the current contact
Definition ElogContact.h:83
virtual ~ElogContact()
int i_contact_id
contact id
Definition ElogContact.h:26
TString * str_phones
phones
Definition ElogContact.h:32