mirror of
https://github.com/resiprocate/resiprocate.git
synced 2026-01-12 00:05:02 +08:00
git-svn-id: https://svn.resiprocate.org/rep/resiprocate/main@8072 ddefafc4-47db-0310-ae44-fa13212b10f2
37 lines
832 B
C++
37 lines
832 B
C++
#ifndef __P2P_DESTINATION_ID_HXX
|
|
#define __P2P_DESTINATION_ID_HXX
|
|
|
|
#include "p2p/MessageStructsGen.hxx"
|
|
#include "p2p/NodeId.hxx"
|
|
#include "p2p/ResourceId.hxx"
|
|
|
|
namespace p2p
|
|
{
|
|
|
|
// Either a CompressedId, NodeId or ResourceId
|
|
class DestinationId : private s2c::DestinationStruct
|
|
{
|
|
public:
|
|
DestinationId(s2c::DestinationStruct);
|
|
DestinationId(const NodeId& nid);
|
|
DestinationId(const ResourceId& rid);
|
|
|
|
bool isNodeId() const;
|
|
NodeId asNodeId() const;
|
|
|
|
bool isCompressedId() const;
|
|
CompressedId asCompressedId() const;
|
|
|
|
bool isResourceId() const;
|
|
ResourceId asResourceId() const;
|
|
|
|
bool operator==(const NodeId& nid) const;
|
|
bool operator==(const DestinationId& nid) const;
|
|
|
|
s2c::DestinationStruct* copyDestinationStruct() const;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|