ROOT logo
// $Id: SXrdServerId.h 2670 2012-02-27 20:33:23Z matevz $

// Copyright (C) 1999-2008, Matevz Tadel. All rights reserved.
// This file is part of GLED, released under GNU General Public License version 2.
// For the licensing terms see $GLEDSYS/LICENSE or http://www.gnu.org/.

#ifndef XrdMon_SXrdServerId_H
#define XrdMon_SXrdServerId_H

#include <Gled/GledTypes.h>

class SXrdServerId
{
public:
  UInt_t   ip4;
  Int_t    stod;
  UShort_t port;

public:
  SXrdServerId() { Clear(); }
  SXrdServerId(UInt_t _ip4, Int_t _stod, UShort_t _port) :
    ip4(_ip4), stod(_stod), port(_port) {}

  void Clear();

  bool operator==(const SXrdServerId& si) const
  { return ip4 == si.ip4 && stod == si.stod && port == si.port; }

#ifndef __CINT__
  struct Hash
  {
    // Initially the plan was to use CRC32 ... but this should be just as good.
    hash<size_t> hfoo;
    size_t operator()(const SXrdServerId& si) const
    { return hfoo((size_t) si.ip4 * (size_t) si.stod * (size_t) si.port); }
  };
#endif

#include "SXrdServerId.h7"
  ClassDefNV(SXrdServerId, 1);
}; // endclass SXrdServerId

#endif
 SXrdServerId.h:1
 SXrdServerId.h:2
 SXrdServerId.h:3
 SXrdServerId.h:4
 SXrdServerId.h:5
 SXrdServerId.h:6
 SXrdServerId.h:7
 SXrdServerId.h:8
 SXrdServerId.h:9
 SXrdServerId.h:10
 SXrdServerId.h:11
 SXrdServerId.h:12
 SXrdServerId.h:13
 SXrdServerId.h:14
 SXrdServerId.h:15
 SXrdServerId.h:16
 SXrdServerId.h:17
 SXrdServerId.h:18
 SXrdServerId.h:19
 SXrdServerId.h:20
 SXrdServerId.h:21
 SXrdServerId.h:22
 SXrdServerId.h:23
 SXrdServerId.h:24
 SXrdServerId.h:25
 SXrdServerId.h:26
 SXrdServerId.h:27
 SXrdServerId.h:28
 SXrdServerId.h:29
 SXrdServerId.h:30
 SXrdServerId.h:31
 SXrdServerId.h:32
 SXrdServerId.h:33
 SXrdServerId.h:34
 SXrdServerId.h:35
 SXrdServerId.h:36
 SXrdServerId.h:37
 SXrdServerId.h:38
 SXrdServerId.h:39
 SXrdServerId.h:40
 SXrdServerId.h:41
 SXrdServerId.h:42
 SXrdServerId.h:43