Savarese Software Research Corporation
service/protocol.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2006-2009 Savarese Software Research Corporation
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     https://www.savarese.com/software/ApacheLicense-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00022 #ifndef __SSRC_WSPR_SERVICE_PROTOCOL_H
00023 #define __SSRC_WSPR_SERVICE_PROTOCOL_H
00024 
00025 #include <ssrc/wispers/protocol.h>
00026 #include <ssrc/wispers/utility/properties_ptr.h>
00027 
00028 __BEGIN_NS_SSRC_WSPR_PROTOCOL
00029 
00030 WSPR_DEFINE_PROTOCOL(Service,service);
00031 
00032 __END_NS_SSRC_WSPR_PROTOCOL
00033 
00034 __BEGIN_NS_SSRC_WSPR_SERVICE
00035 
00036 using std::string;
00037 using NS_SSRC_WSPR_UTILITY::properties_ptr;
00038 
00039 struct ServiceProtocol : public protocol::ServiceProtocol<protocol::Service> {
00040   enum MessageType {
00041     Stop, EchoRequest, EchoReply, Reregister, StatusRequest, StatusReply
00042   };
00043 
00044   typedef protocol::MessageService<Stop> MessageStop;
00045   typedef protocol::MessageService<EchoRequest> MessageEchoRequest;
00046   typedef protocol::MessageService<EchoReply> MessageEchoReply;
00047   typedef protocol::MessageService<StatusRequest> MessageStatusRequest;
00048 
00049   WISP_PROTOCOL_MESSAGE(Reregister, protocol::MessageService,
00050                        ((string, registry)));
00051 
00052   WISP_PROTOCOL_MESSAGE(StatusReply, protocol::MessageService,
00053                         ((properties_ptr, status)));
00054 
00055   WISP_ONE_WAY_CALL(caller_type, Stop);
00056   WISP_ONE_WAY_CALL(caller_type, EchoReply);
00057   WISP_TWO_WAY_CALL(caller_type, EchoRequest, EchoReply);
00058   WISP_ONE_WAY_CALL(caller_type, Reregister);
00059   WISP_ONE_WAY_CALL(caller_type, StatusRequest);
00060   WISP_ONE_WAY_CALL(caller_type, StatusReply);
00061 };
00062 
00063 __END_NS_SSRC_WSPR_SERVICE
00064 
00065 #endif

Savarese Software Research Corporation
Copyright © 2006-2011 Savarese Software Research Corporation. All rights reserved.