Wisp 1.3.1 C++ Unit Test Coverage
Current view: top level - examples/echo - echo_protocol.h (source / functions) Hit Total Coverage
Test: Wisp 1.3.1 C++ Unit Tests Lines: 3 3 100.0 %
Date: 2017-01-16 Functions: 14 14 100.0 %
Branches: 0 0 -

           Branch data     Line data    Source code
       1                 :            : /*
       2                 :            :  * Copyright 2006-2008 Savarese Software Research Corporation
       3                 :            :  *
       4                 :            :  * Licensed under the Apache License, Version 2.0 (the "License");
       5                 :            :  * you may not use this file except in compliance with the License.
       6                 :            :  * You may obtain a copy of the License at
       7                 :            :  *
       8                 :            :  *     http://www.savarese.com/software/ApacheLicense-2.0
       9                 :            :  *
      10                 :            :  * Unless required by applicable law or agreed to in writing, software
      11                 :            :  * distributed under the License is distributed on an "AS IS" BASIS,
      12                 :            :  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      13                 :            :  * See the License for the specific language governing permissions and
      14                 :            :  * limitations under the License.
      15                 :            :  */
      16                 :            : 
      17                 :            : #ifndef __WISP_EXAMPLE_ECHO_PROTOCOL_H
      18                 :            : #define __WISP_EXAMPLE_ECHO_PROTOCOL_H
      19                 :            : 
      20                 :            : #include <ssrc/wisp/protocol.h>
      21                 :            : 
      22                 :            : enum ProtocolNumber {
      23                 :            :   Echo = 2038
      24                 :            : };
      25                 :            : 
      26                 :         18 : WISP_DEFINE_PROTOCOL(Echo);
      27                 :            : 
      28                 :            : struct EchoProtocol : public ssrc::wisp::protocol::ServiceProtocol<Echo> {
      29                 :            :   enum MessageType {
      30                 :            :     Stop, EchoRequest, EchoReply
      31                 :            :   };
      32                 :            : 
      33                 :            :   typedef MessageEcho<Stop> MessageStop;
      34                 :            : 
      35                 :         18 :   WISP_PROTOCOL_MESSAGE(EchoRequest, MessageEcho, ((std::string, payload)));
      36                 :         18 :   WISP_PROTOCOL_MESSAGE(EchoReply, MessageEcho, ((std::string, payload)));
      37                 :            : 
      38                 :            :   WISP_ONE_WAY_CALL(caller_type, Stop);
      39                 :            :   WISP_TWO_WAY_CALL(caller_type, EchoRequest, EchoReply);
      40                 :            :   WISP_ONE_WAY_CALL(caller_type, EchoReply);
      41                 :            : };
      42                 :            : 
      43                 :            : #endif