1 #include <rms/provider/EpicsConnection.h> 28 const int applicationPartition) {
31 ca_context_create(ca_enable_preemptive_callback);
37 if (gethostname(hostname, 20) == 0) {
119 const base::RmsMessage&
message) {
126 std::string serializedMessage = message.serialize();
250 ca_create_channel(destinationPV.c_str(), NULL, NULL, 10, &channelID);
251 result = ca_pend_io(0.5);
252 ca_clear_channel(channelID);
254 if (result != ECA_NORMAL) {
267 std::map <std::string, EpicsMessenger *>::iterator cacheIterator;
279 delete cacheIterator->second;
287 ca_context_destroy();
320 if (destinationEnvironment !=
"") {
321 destinationPV.append(destinationEnvironment +
"_");
324 destinationPV.append(destinationTarget);
326 destinationPV.append(destinationChannel);
328 destinationPV.append(
"outbox");
329 return destinationPV;
332 if (destinationEnvironment !=
"") {
333 destinationPV.append(destinationEnvironment +
"_");
336 destinationPV.append(destinationTarget);
338 destinationPV.append(destinationPartition);
340 destinationPV.append(destinationChannel);
342 destinationPV.append(
"inbox");
344 return destinationPV;
377 targetName.append(destinationPartition);
379 targetName.append(destinationChannel);
381 targetName.append(
"monitoringOutbox");
386 if (destinationEnvironment !=
"") {
387 targetName.insert(0, destinationEnvironment +
"_");
405 std::map <std::string, EpicsMessenger *>::iterator cacheIterator;
415 _cachedPVs.insert(std::pair<std::string, EpicsMessenger *>
419 return cacheIterator->second;
bool ping(const base::RmsDestination &pingDestination)
void addListener(const base::RmsDestination &dest, ProviderListener *listener)
util::UUIDGenerator * _uuidGenerator
static const std::string PV_DELIMITER
void sendMessage(const base::RmsDestination &dest, const base::RmsMessage &message)
static const std::string PARTITION_PROPERTY_NAME
std::map< std::string, EpicsMessenger * > _cachedPVs
base::RmsDestination _messageSource
static const std::string SOURCE_PROPERTY_NAME
struct ca_client_context * _caCurrentContext
EpicsConnection(const std::string applicationName, const int applicationPartition)
static const std::string HEARTBEAT_CHANNEL
void removeListener(ProviderListener *listener)
void addListener(ProviderListener *listener)
static const std::string CHANNEL_PROPERTY_NAME
bool supportsDestination(const base::RmsDestination &candidateDestination)
std::string getMonitoringPVFromDest(const base::RmsDestination &dest) const
void sendMessage(const std::string &messageText)
void sendString(const base::RmsDestination &dest, const std::string &messageString)
static const std::string ENVIRONMENT_PROPERTY_NAME
void removeListener(const base::RmsDestination &dest, ProviderListener *listener)
std::string getDestinationPVFromDest(const base::RmsDestination &dest) const
EpicsMessenger * getPVHandle(std::string pvName)
static const std::string TARGET_PROPERTY_NAME