Logo ROOT   6.16/01
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
30class TBonjourRecord : public TObject {
31
32private:
37
38public:
40 TBonjourRecord(const char *name, const char *regType, const char *domain) :
42 fTXTRecords("") { }
43 TBonjourRecord(const char *name, const char *regType, const char *domain,
44 const char *txt) :
46 fReplyDomain(domain), fTXTRecords(txt) { }
47 virtual ~TBonjourRecord() { }
48
49 Bool_t operator==(const TBonjourRecord &other) const {
50 return fServiceName == other.fServiceName &&
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; }
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 Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
const char Option_t
Definition: RtypesCore.h:62
#define ClassDef(name, id)
Definition: Rtypes.h:324
const char * GetReplyDomain() const
TBonjourRecord(const char *name, const char *regType, const char *domain, const char *txt)
TString fReplyDomain
const char * GetServiceName() const
Int_t GetTXTRecordsLength() const
TString fTXTRecords
void Print(Option_t *opt="") const
Print TBonjourRecord.
const char * GetTXTRecords() const
Bool_t operator==(const TBonjourRecord &other) const
Bool_t IsEqual(const TObject *obj) const
Default equal comparison (objects are equal if they have the same address in memory).
const char * GetRegisteredType() const
virtual ~TBonjourRecord()
TBonjourRecord(const char *name, const char *regType, const char *domain)
void AddTXTRecord(const char *record)
TString fServiceName
TString fRegisteredType
Mother of all ROOT objects.
Definition: TObject.h:37
Basic string class.
Definition: TString.h:131
Ssiz_t Length() const
Definition: TString.h:405