Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
cmsos
worksuite
Commits
bf5b21d4
Commit
bf5b21d4
authored
Sep 16, 2021
by
Dainius Simelevicius
Browse files
references
#263
: refactoring dipbridge code
parent
5e2bf269
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
dipbridge/include/dipbridge/Application.h
View file @
bf5b21d4
// $Id$
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-202
0
, CERN. *
* Copyright (C) 2000-202
1
, CERN. *
* All rights reserved. *
* Authors: Zhen Xie, Luciano Orsini
,
Dainius Simelevicius
*
* Authors: Zhen Xie, Luciano Orsini
and
Dainius Simelevicius
*
* For the licensing terms see LICENSE. *
* For the list of contributors see CREDITS. *
*************************************************************************/
...
...
@@ -49,6 +47,22 @@ namespace dipbridge
class
PubErrorHandler
;
class
ServerErrorHandler
;
enum
Command
{
update
,
destroy
,
incUpdate
,
incPublish
,
dipPublish
};
class
DipCommand
{
public:
DipCommand
(
Command
c
,
const
std
::
string
&
topic
);
DipCommand
(
Command
c
,
const
std
::
string
&
topic
,
xdata
::
Table
::
Reference
&
tabRef
);
Command
getCommand
();
std
::
string
getTopic
();
xdata
::
Table
::
Reference
getTable
();
protected:
Command
c_
;
std
::
string
topic_
;
xdata
::
Table
::
Reference
tabRef_
;
};
/**
receive xdata::Table from eventing and publish it to dip
subscribe to dip topic and send it as xdata::Table to eventing
...
...
@@ -64,55 +78,58 @@ namespace dipbridge
public:
XDAQ_INSTANTIATOR
();
// constructor
Application
(
xdaq
::
ApplicationStub
*
s
);
Application
(
xdaq
::
ApplicationStub
*
s
);
// destructor
~
Application
();
// xgi(web) callback
void
Default
(
xgi
::
Input
*
in
,
xgi
::
Output
*
out
);
// infospace event callback
virtual
void
actionPerformed
(
xdata
::
Event
&
e
);
virtual
void
actionPerformed
(
xdata
::
Event
&
e
);
// toolbox event callback
virtual
void
actionPerformed
(
toolbox
::
Event
&
e
);
virtual
void
actionPerformed
(
toolbox
::
Event
&
e
);
// b2in callback
void
onMessage
(
toolbox
::
mem
::
Reference
*
ref
,
xdata
::
Properties
&
plist
);
// dip message handler
void
handleMessage
(
DipSubscription
*
dipsub
,
DipData
&
message
);
void
handleMessage
(
DipSubscription
*
dipsub
,
DipData
&
message
);
// DipSubscriptionListener methods
void
connected
(
DipSubscription
*
dipsub
);
void
connected
(
DipSubscription
*
dipsub
);
// DipSubscriptionListener methods
void
disconnected
(
DipSubscription
*
subscription
,
char
*
reason
);
void
disconnected
(
DipSubscription
*
subscription
,
char
*
reason
);
// DipSubscriptionListener methods
void
handleException
(
DipSubscription
*
subscription
,
DipException
&
ex
);
// workloop method
bool
publishingToDip
(
toolbox
::
task
::
WorkLoop
*
wl
);
void
handleException
(
DipSubscription
*
subscription
,
DipException
&
ex
);
private:
void
publishDipMessageToEventing
(
const
std
::
string
&
dipname
,
xdata
::
Table
&
dipmessage
);
void
publishDipMessageToEventing
(
const
std
::
string
&
dipname
,
xdata
::
Table
&
dipmessage
);
void
process
(
std
::
string
name
);
void
init
(
std
::
string
name
);
protected:
std
::
string
m_
processuuid
;
toolbox
::
BSem
m_
applock
;
bool
m_
busready
;
DipFactory
*
pm_
dip
;
toolbox
::
mem
::
Pool
*
pm_
memPool
;
PubErrorHandler
*
pm_
puberrorhandler
;
ServerErrorHandler
*
pm_
servererrorhandler
;
std
::
string
processuuid
_
;
toolbox
::
BSem
applock
_
;
bool
busready
_
;
DipFactory
*
dip
_
;
toolbox
::
mem
::
Pool
*
memPool
_
;
PubErrorHandler
*
puberrorhandler
_
;
ServerErrorHandler
*
servererrorhandler
_
;
// config parameters
xdata
::
String
m_
bus
;
xdata
::
Vector
<
xdata
::
String
>
m_
dipSubTopics
;
xdata
::
S
tring
m_
dipDataTopic
;
xdata
::
Integer32
m_
throttle
_t
hreshold
_m
illisec
;
xdata
::
String
bus
_
;
xdata
::
Vector
<
xdata
::
String
>
dipSubTopics
_
;
std
::
s
tring
dipDataTopic
_
;
xdata
::
Integer32
throttle
T
hreshold
M
illisec
_
;
// registries
std
::
map
<
std
::
string
,
DipSubscription
*
>
m_dipsubs
;
std
::
map
<
std
::
string
,
dipDataInsert
*
>
m_dippubs
;
std
::
map
<
std
::
string
,
long
long
>
m_millisecsincelast
;
xdata
::
exdr
::
Serializer
m_serializer
;
// outdata queue
std
::
map
<
dipDataInsert
*
,
toolbox
::
squeue
<
xdata
::
Table
::
Reference
>*
>
m_dippubqueuestore
;
// workloops
toolbox
::
task
::
WorkLoop
*
pm_pubtodip_wl
;
toolbox
::
task
::
ActionSignature
*
pm_pubtodip_as
;
std
::
map
<
std
::
string
,
DipSubscription
*
>
dipsubs_
;
std
::
map
<
std
::
string
,
dipDataInsert
*
>
dippubs_
;
std
::
map
<
std
::
string
,
long
long
>
millisecSinceLast_
;
xdata
::
exdr
::
Serializer
serializer_
;
// statistics
typedef
struct
stat
{
size_t
requestDipUpdateCounter
;
size_t
updateDipCounter
;
size_t
publishToEventingCounter
;
}
Stat
;
std
::
map
<
std
::
string
,
Stat
>
statistics_
;
toolbox
::
squeue
<
DipCommand
*
>
commandQueue_
;
};
}
#endif
dipbridge/include/dipbridge/version.h
View file @
bf5b21d4
// $Id$
/*************************************************************************
* XDAQ Components for Distributed Data Acquisition *
* Copyright (C) 2000-2021, CERN. *
...
...
@@ -17,7 +15,7 @@
// !!! Edit this line to reflect the latest package version !!!
#define WORKSUITE_DIPBRIDGE_VERSION_MAJOR 3
#define WORKSUITE_DIPBRIDGE_VERSION_MINOR
2
#define WORKSUITE_DIPBRIDGE_VERSION_MINOR
3
#define WORKSUITE_DIPBRIDGE_VERSION_PATCH 0
// If any previous versions available E.g. #define ESOURCE_PREVIOUS_VERSIONS "3.8.0,3.8.1"
#define DIPBRIDGE_PREVIOUS_VERSIONS
...
...
dipbridge/src/common/Application.cc
View file @
bf5b21d4
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment