BmnRoot
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
10#ifndef ElogPerson_H
11#define ElogPerson_H 1
12
13#include "ElogConnection.h"
14
15#include "TDatime.h"
16#include "TObjArray.h"
17#include "TString.h"
18
20{
21 private:
22 /* GENERATED PRIVATE MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
24 ElogConnection* connectionDB;
25
27 TString str_person_id;
29 TString str_person_name;
31 bool b_is_active;
33 TString* str_email;
34
35 // Constructor
36 ElogPerson(ElogConnection* db_connect, TString person_id, TString person_name, bool is_active, TString* email);
37 /* END OF PRIVATE GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
38
39 public:
40 /* GENERATED PUBLIC MEMBERS (SHOULD NOT BE CHANGED MANUALLY) */
41 virtual ~ElogPerson(); // Destructor
42
43 // static class functions
45 static ElogPerson* CreatePerson(TString person_name, bool is_active, TString* email);
47 static ElogPerson* GetPerson(TString person_id);
49 static int CheckPersonExists(TString person_id);
51 static int DeletePerson(TString person_id);
53 static int PrintAll();
54
55 // Getters
57 TString GetPersonId() { return str_person_id; }
59 TString GetPersonName() { return str_person_name; }
61 bool GetIsActive() { return b_is_active; }
63 TString* GetEmail()
64 {
65 if (str_email == nullptr)
66 return nullptr;
67 else
68 return new TString(*str_email);
69 }
70
71 // Setters
73 int SetPersonName(TString person_name);
75 int SetIsActive(bool is_active);
77 int SetEmail(TString* email);
78
80 void Print();
81 /* END OF PUBLIC GENERATED PART (SHOULD NOT BE CHANGED MANUALLY) */
82
84 static TObjArray* GetPersonByName(TString person_name_part);
87 static int CheckPersonExistsByName(TString person_name_part);
90 static int DeletePersonByName(TString person_name_part);
91
93};
94
95#endif
TString GetPersonName()
get person name of the current person
Definition ElogPerson.h:59
static int CheckPersonExistsByName(TString person_name_part)
int SetIsActive(bool is_active)
set is active of the current person
TString * GetEmail()
get email of the current person
Definition ElogPerson.h:63
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)
bool GetIsActive()
get is active of the current person
Definition ElogPerson.h:61
ClassDef(ElogPerson, 1)
static TObjArray * GetPersonByName(TString person_name_part)
get persons from the database by name or its part
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:57
int SetEmail(TString *email)
set email of the current person
virtual ~ElogPerson()
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