~ubuntu-branches/ubuntu/saucy/resiprocate/saucy-proposed

« back to all changes in this revision

Viewing changes to p2p/Join.hxx

  • Committer: Package Import Robot
  • Author(s): Daniel Pocock
  • Date: 2012-05-17 19:29:59 UTC
  • Revision ID: package-import@ubuntu.com-20120517192959-vv00m77isztdy64q
Tags: upstream-1.8.2
ImportĀ upstreamĀ versionĀ 1.8.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#if !defined(P2P_JOIN_HXX)
 
2
#define P2P_JOIN_HXX
 
3
 
 
4
#include "p2p/Message.hxx"
 
5
#include "p2p/EventWrapper.hxx"
 
6
 
 
7
namespace p2p 
 
8
{
 
9
 
 
10
class JoinReq;
 
11
 
 
12
class JoinAns : public Message, private s2c::JoinAnsStruct
 
13
{
 
14
public:
 
15
    friend class Message;
 
16
    
 
17
    JoinAns(p2p::JoinReq *request, const resip::Data &overlaySpecific = resip::Data::Empty);
 
18
    virtual MessageType getType() const { return Message::JoinAnsType; }
 
19
    
 
20
    virtual void getEncodedPayload(resip::DataStream &data);
 
21
    virtual resip::Data brief() const { return "JoinAns Message"; }
 
22
    
 
23
    std::auto_ptr<Event> event() {return wrap(this);}
 
24
 
 
25
protected:
 
26
        virtual void decodePayload(resip::DataStream &dataStream);
 
27
        JoinAns();
 
28
};
 
29
 
 
30
class JoinReq : public Message, private s2c::JoinReqStruct
 
31
{
 
32
public:
 
33
        JoinReq(const DestinationId &dest, const NodeId &nodeId, const resip::Data &overlaySpecific=resip::Data::Empty);
 
34
      
 
35
        virtual MessageType getType() const { return Message::JoinReqType; }
 
36
        NodeId getNodeId() const;
 
37
      
 
38
        virtual void getEncodedPayload(resip::DataStream &data);
 
39
        virtual resip::Data brief() const { return "JoinReq Message"; }
 
40
 
 
41
    std::auto_ptr<Event> event() {return wrap(this);}
 
42
 
 
43
protected:
 
44
        virtual void decodePayload(resip::DataStream &dataStream);
 
45
        JoinReq();
 
46
 
 
47
        NodeId mNodeId;
 
48
        resip::Data mOverlaySpecific;
 
49
 
 
50
        friend class Message;
 
51
};
 
52
 
 
53
 
 
54
}
 
55
 
 
56
#endif
 
57
 
 
58
/* ======================================================================
 
59
 *  Copyright (c) 2008, Various contributors to the Resiprocate project
 
60
 *  All rights reserved.
 
61
 *  
 
62
 *  Redistribution and use in source and binary forms, with or without
 
63
 *  modification, are permitted provided that the following conditions
 
64
 *  are met:
 
65
 *
 
66
 *      - Redistributions of source code must retain the above copyright
 
67
 *        notice, this list of conditions and the following disclaimer.
 
68
 *
 
69
 *      - Redistributions in binary form must reproduce the above
 
70
 *        copyright notice, this list of conditions and the following
 
71
 *        disclaimer in the documentation and/or other materials
 
72
 *        provided with the distribution.
 
73
 *
 
74
 *      - The names of the project's contributors may not be used to
 
75
 *        endorse or promote products derived from this software without
 
76
 *        specific prior written permission.
 
77
 *
 
78
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
79
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
80
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 
81
 *  FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 
82
 *  COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 
83
 *  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 
84
 *  BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 
85
 *  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 
86
 *  CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 
87
 *  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 
88
 *  IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
 
89
 *  THE POSSIBILITY OF SUCH DAMAGE.
 
90
 *====================================================================== */