Logo ROOT   6.12/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 #include "TObject.h"
25 
26 #include "TString.h"
27 
28 
29 
30 class TBonjourRecord : public TObject {
31 
32 private:
37 
38 public:
40  TBonjourRecord(const char *name, const char *regType, const char *domain) :
41  fServiceName(name), fRegisteredType(regType), fReplyDomain(domain),
42  fTXTRecords("") { }
43  TBonjourRecord(const char *name, const char *regType, const char *domain,
44  const char *txt) :
45  fServiceName(name), fRegisteredType(regType),
46  fReplyDomain(domain), fTXTRecords(txt) { }
47  virtual ~TBonjourRecord() { }
48 
49  Bool_t operator==(const TBonjourRecord &other) const {
50  return fServiceName == other.fServiceName &&
51  fRegisteredType == other.fRegisteredType &&
52  fReplyDomain == other.fReplyDomain &&
53  fTXTRecords == other.fTXTRecords;
54  }
55 
56  Bool_t IsEqual(const TObject *obj) const { return *this == *(TBonjourRecord*)obj; }
57 
58  const char *GetServiceName() const { return fServiceName; }
59  const char *GetRegisteredType() const { return fRegisteredType; }
60  const char *GetReplyDomain() const { return fReplyDomain; }
61  const char *GetTXTRecords() const { return fTXTRecords; }
62  Int_t GetTXTRecordsLength() const { return fTXTRecords.Length(); }
63 
64  void AddTXTRecord(const char *record);
65  void AddTXTRecord(const TString &record);
66 
67  void Print(Option_t *opt = "") const;
68 
69  ClassDef(TBonjourRecord,0) // Bonjour information record
70 };
71 
72 #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:125
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:320
virtual ~TBonjourRecord()
void AddTXTRecord(const char *record)
TBonjourRecord(const char *name, const char *regType, const char *domain)
Ssiz_t Length() const
Definition: TString.h:386
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