7 #ifndef BASECHANNELREQUESTER_H_
8 #define BASECHANNELREQUESTER_H_
10 #include <pv/requester.h>
11 #include <pv/destroyable.h>
12 #include <pv/serverContextImpl.h>
13 #include <pv/serverChannelImpl.h>
21 class BaseChannelRequester :
22 virtual public epics::pvData::Requester,
23 public TransportSender,
28 POINTER_DEFINITIONS(BaseChannelRequester);
29 BaseChannelRequester(ServerContextImpl::shared_pointer
const & context, std::tr1::shared_ptr<ServerChannel>
const & channel,
30 const pvAccessID ioid, Transport::shared_pointer
const & transport);
31 virtual ~BaseChannelRequester() {};
33 bool startRequest(epics::pvData::int32 qos);
35 epics::pvData::int32 getPendingRequest();
37 virtual std::tr1::shared_ptr<ChannelRequest> getOperation() =0;
38 virtual std::string getRequesterName() OVERRIDE FINAL;
39 virtual
void message(std::
string const & message, epics::pvData::MessageType messageType) OVERRIDE FINAL;
40 static
void message(Transport::shared_pointer const & transport, const pvAccessID ioid, const std::
string message, const epics::pvData::MessageType messageType);
41 static
void sendFailureMessage(const epics::pvData::int8 command, Transport::shared_pointer const & transport, const pvAccessID ioid, const epics::pvData::int8 qos, const epics::pvData::Status status);
43 virtual
void stats(Stats &s) const OVERRIDE FINAL;
45 static const epics::pvData::Status okStatus;
46 static const epics::pvData::Status badCIDStatus;
47 static const epics::pvData::Status badIOIDStatus;
48 static const epics::pvData::Status noReadACLStatus;
49 static const epics::pvData::Status noWriteACLStatus;
50 static const epics::pvData::Status noProcessACLStatus;
51 static const epics::pvData::Status otherRequestPendingStatus;
52 static const epics::pvData::Status notAChannelRequestStatus;
54 const pvAccessID _ioid;
55 const Transport::shared_pointer _transport;
56 const std::tr1::shared_ptr<ServerChannel> _channel;
57 epics::pvData::Mutex _mutex;
59 ServerContextImpl::shared_pointer _context;
60 static const epics::pvData::int32 NULL_REQUEST;
61 epics::pvData::int32 _pendingRequest;
64 class BaseChannelRequesterMessageTransportSender : public TransportSender
67 BaseChannelRequesterMessageTransportSender(
const pvAccessID _ioid,
const std::string message,
const epics::pvData::MessageType messageType);
68 virtual void send(epics::pvData::ByteBuffer* buffer, TransportSendControl* control) OVERRIDE FINAL;
70 const pvAccessID _ioid;
72 const epics::pvData::MessageType _messageType;
75 class BaseChannelRequesterFailureMessageTransportSender :
public TransportSender
78 BaseChannelRequesterFailureMessageTransportSender(
const epics::pvData::int8 command, Transport::shared_pointer
const & transport,
const pvAccessID ioid,
const epics::pvData::int8 qos,
const epics::pvData::Status& status);
79 virtual void send(epics::pvData::ByteBuffer* buffer, TransportSendControl* control) OVERRIDE FINAL;
82 const epics::pvData::int8 _command;
83 const pvAccessID _ioid;
84 const epics::pvData::int8 _qos;
85 const epics::pvData::Status _status;
86 Transport::shared_pointer _transport;
virtual void send(epics::pvData::ByteBuffer *buffer, TransportSendControl *control)=0
Called by transport.