Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
RadioObservatory
LOFAR
Commits
f5c391a5
Commit
f5c391a5
authored
10 years ago
by
Jan Rinze Peterzon
Browse files
Options
Downloads
Patches
Plain Diff
Task #7342: New MessageBus.h
parent
34c0c246
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
LCS/MessageBus/include/MessageBus/MsgBus.h
+5
-56
5 additions, 56 deletions
LCS/MessageBus/include/MessageBus/MsgBus.h
with
5 additions
and
56 deletions
LCS/MessageBus/include/MessageBus/MsgBus.h
+
5
−
56
View file @
f5c391a5
...
@@ -42,14 +42,8 @@ EXCEPTION_CLASS(MessageBusException, LOFAR::Exception);
...
@@ -42,14 +42,8 @@ EXCEPTION_CLASS(MessageBusException, LOFAR::Exception);
class
FromBus
class
FromBus
{
{
const
std
::
string
itsBrokerName
;
const
std
::
string
itsQueueName
;
#ifdef HAVE_QPID
qpid
::
messaging
::
Connection
itsConnection
;
qpid
::
messaging
::
Connection
itsConnection
;
qpid
::
messaging
::
Session
itsSession
;
qpid
::
messaging
::
Session
itsSession
;
qpid
::
messaging
::
Receiver
receiver
;
#endif
int
itsNrMissingACKs
;
int
itsNrMissingACKs
;
...
@@ -57,72 +51,27 @@ public:
...
@@ -57,72 +51,27 @@ public:
FromBus
(
const
std
::
string
&
address
=
"testqueue"
,
const
std
::
string
&
options
=
"; {create: always}"
,
const
std
::
string
&
broker
=
"amqp:tcp:127.0.0.1:5672"
)
;
FromBus
(
const
std
::
string
&
address
=
"testqueue"
,
const
std
::
string
&
options
=
"; {create: always}"
,
const
std
::
string
&
broker
=
"amqp:tcp:127.0.0.1:5672"
)
;
~
FromBus
(
void
);
~
FromBus
(
void
);
bool
getString
(
std
::
string
&
str
,
double
timeout
=
0.0
);
// timeout 0.0 means blocking
#ifdef HAVE_QPID
bool
getMessage
(
qpid
::
messaging
::
Message
&
msg
,
double
timeout
=
0.0
);
// timeout 0.0 means blocking
bool
getMessage
(
qpid
::
messaging
::
Message
&
msg
,
double
timeout
=
0.0
);
// timeout 0.0 means blocking
void
nack
(
qpid
::
messaging
::
Message
&
msg
);
void
nack
(
qpid
::
messaging
::
Message
&
msg
);
#endif
void
ack
(
void
);
void
ack
(
qpid
::
messaging
::
Message
&
msg
);
void
reject
(
qpid
::
messaging
::
Message
&
msg
);
void
addQueue
(
const
std
::
string
&
address
=
"testqueue"
,
const
std
::
string
&
options
=
"; {create: always}"
);
};
};
class
ToBus
class
ToBus
{
{
const
std
::
string
itsBrokerName
;
const
std
::
string
itsQueueName
;
#ifdef HAVE_QPID
qpid
::
messaging
::
Connection
itsConnection
;
qpid
::
messaging
::
Connection
itsConnection
;
qpid
::
messaging
::
Session
itsSession
;
qpid
::
messaging
::
Session
itsSession
;
qpid
::
messaging
::
Sender
sender
;
qpid
::
messaging
::
Sender
itsSender
;
#endif
public:
public:
ToBus
(
const
std
::
string
&
address
=
"testqueue"
,
const
std
::
string
&
options
=
"; {create: always}"
,
const
std
::
string
&
broker
=
"amqp:tcp:127.0.0.1:5672"
)
;
ToBus
(
const
std
::
string
&
address
=
"testqueue"
,
const
std
::
string
&
options
=
"; {create: always}"
,
const
std
::
string
&
broker
=
"amqp:tcp:127.0.0.1:5672"
)
;
~
ToBus
(
void
);
~
ToBus
(
void
);
void
send
(
const
std
::
string
&
msg
);
void
send
(
const
std
::
string
&
msg
);
};
};
class
MultiBus
{
public:
typedef
bool
(
*
MsgHandler
)(
const
std
::
string
&
,
const
std
::
string
&
);
private:
const
std
::
string
itsBrokerName
;
#ifdef HAVE_QPID
std
::
map
<
std
::
string
,
qpid
::
messaging
::
Receiver
>
itsReceivers
;
qpid
::
messaging
::
Connection
itsConnection
;
qpid
::
messaging
::
Session
itsSession
;
#endif
int
itsNrMissingACKs
;
public:
MultiBus
(
const
std
::
string
&
broker
=
"amqp:tcp:127.0.0.1:5672"
);
~
MultiBus
();
void
addQueue
(
const
std
::
string
&
address
=
"testqueue"
,
const
std
::
string
&
options
=
"; {create: always}"
);
void
handleMessages
(
void
);
#ifdef HAVE_QPID
bool
getMessage
(
qpid
::
messaging
::
Message
&
msg
,
double
timeout
=
0.0
);
// timeout 0.0 means blocking
void
nack
(
qpid
::
messaging
::
Message
&
msg
);
#endif
#endif
void
ack
(
void
);
bool
getString
(
std
::
string
&
str
,
double
timeout
=
0.0
);
// timeout 0.0 means blocking
};
}
// namespace LOFAR
#endif
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment