Logo ROOT   6.08/07
Reference Guide
TBonjourRecord.h
Go to the documentation of this file.
1 // @(#)root/bonjour:$Id$
2 // Author: Fons Rademakers 29/05/2009
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2009, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TBonjourRecord
13 #define ROOT_TBonjourRecord
14 
15 
16 //////////////////////////////////////////////////////////////////////////
17 // //
18 // TBonjourRecord //
19 // //
20 // Contains all information concerning a Bonjour entry. //
21 // //
22 //////////////////////////////////////////////////////////////////////////
23 
24 #ifndef ROOT_TObject
25 #include "TObject.h"
26 #endif
27 
28 #ifndef ROOT_TString
29 #include "TString.h"
30 #endif
31 
32 
33 
34 class TBonjourRecord : public TObject {
35 
36 private:
41 
42 public:
44  TBonjourRecord(const char *name, const char *regType, const char *domain) :
45  fServiceName(name), fRegisteredType(regType), fReplyDomain(domain),
46  fTXTRecords("") { }
47  TBonjourRecord(const char *name, const char *regType, const char *domain,
48  const char *txt) :
49  fServiceName(name), fRegisteredType(regType),
50  fReplyDomain(domain), fTXTRecords(txt) { }
51  virtual ~TBonjourRecord() { }
52 
53  Bool_t operator==(const TBonjourRecord &other) const {
54  return fServiceName == other.fServiceName &&
55  fRegisteredType == other.fRegisteredType &&
56  fReplyDomain == other.fReplyDomain &&
57  fTXTRecords == other.fTXTRecords;
58  }
59 
60  Bool_t IsEqual(const TObject *obj) const { return *this == *(TBonjourRecord*)obj; }
61 
62  const char *GetServiceName() const { return fServiceName; }
63  const char *GetRegisteredType() const { return fRegisteredType; }
64  const char *GetReplyDomain() const { return fReplyDomain; }
65  const char *GetTXTRecords() const { return fTXTRecords; }
66  Int_t GetTXTRecordsLength() const { return fTXTRecords.Length(); }
67 
68  void AddTXTRecord(const char *record);
69  void AddTXTRecord(const TString &record);
70 
71  void Print(Option_t *opt = "") const;
72 
73  ClassDef(TBonjourRecord,0) // Bonjour information record
74 };
75 
76 #endif
Int_t GetTXTRecordsLength() const
const char Option_t
Definition: RtypesCore.h:62
Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
void Print(Option_t *opt="") const
Print TBonjourRecord.
Basic string class.
Definition: TString.h:137
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
TBonjourRecord(const char *name, const char *regType, const char *domain, const char *txt)
Bool_t operator==(const TBonjourRecord &other) const
const char * GetTXTRecords() const
#define ClassDef(name, id)
Definition: Rtypes.h:254
virtual ~TBonjourRecord()
void AddTXTRecord(const char *record)
TBonjourRecord(const char *name, const char *regType, const char *domain)
Ssiz_t Length() const
Definition: TString.h:390
TString fReplyDomain
TString fServiceName
TString fRegisteredType
Mother of all ROOT objects.
Definition: TObject.h:37
const char * GetReplyDomain() const
TString fTXTRecords
const char * GetServiceName() const
const char * GetRegisteredType() const
char name[80]
Definition: TGX11.cxx:109