Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
NADS_DDSLIB
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
CI / CD
CI / CD
Pipelines
Schedules
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
NADS-Public
NADS_DDSLIB
Commits
cfc71463
Commit
cfc71463
authored
Oct 09, 2020
by
David Heitbrink
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
minor update, mostly fixed warnings
parent
dbef1c96
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
60 additions
and
20 deletions
+60
-20
DDSSimClient.cpp
DDSSimClient.cpp
+18
-2
DDSSimClient.h
include/NadsDDSLib/DDSSimClient.h
+3
-2
NadsDDSLib.h
include/NadsDDSLib/NadsDDSLib.h
+27
-4
nadsddsimpl.cpp
src/nadsddsimpl.cpp
+1
-1
nadsddsimpl.h
src/nadsddsimpl.h
+6
-6
nadsddslib.cpp
src/nadsddslib.cpp
+5
-5
stdafx.h
stdafx.h
+0
-0
targetver.h
targetver.h
+0
-0
No files found.
DDSSimClient.cpp
View file @
cfc71463
...
...
@@ -5,8 +5,24 @@ namespace NDDSClient {
using
namespace
std
;
CCellInputMap
::
CCellInputMap
()
{}
////////////////////////////////////////////////////////////////////////////////////////////////////
/// \fn void CCellInputMap::RegInpElem(std::string name, void *_pBuffer, size_t _BufferSize, char _BufferType)
///
/// \brief Registers the inp element
///
/// Saves a copy of the void* _pBuffer, the class saves a reference of the buffer. Its critical
/// the user does not delete the buffer, and the size is accurate.
///
/// \author D A Heitbrink
/// \date 10/7/2020
///
/// \param name The name.
/// \param [in,out] _pBuffer If non-null, the buffer.
/// \param _BufferSize Size of the buffer.
/// \param _BufferType Type of the buffer.
////////////////////////////////////////////////////////////////////////////////////////////////////
void
CCellInputMap
::
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
const
unsigned
in
t
_BufferSize
,
char
_BufferType
)
{
void
CCellInputMap
::
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
size_
t
_BufferSize
,
char
_BufferType
)
{
CCellInputMap
::
TCellRef
ref
=
std
::
make_unique
<
CellInput
>
();
ref
->
_sub
=
NADSDDS
::
CSubscription
::
MakeSubscription
(
name
,
_BufferType
);
ref
->
_size
=
_BufferSize
;
...
...
@@ -53,7 +69,7 @@ namespace NDDSClient {
/// \param _BufferType Type of the buffer.
////////////////////////////////////////////////////////////////////////////////////////////////////
void
CCellOutputMap
::
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
const
unsigned
in
t
_BufferSize
,
char
_BufferType
)
{
void
CCellOutputMap
::
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
size_
t
_BufferSize
,
char
_BufferType
)
{
TCellRef
ref
=
std
::
make_unique
<
CellOutput
>
();
size_t
elementSize
=
0
;
switch
(
_BufferType
)
{
...
...
include/NadsDDSLib/DDSSimClient.h
View file @
cfc71463
...
...
@@ -13,6 +13,7 @@
namespace
NDDSClient
{
class
CellInput
{
public
:
CellInput
()
:
_size
(
0
),
_target
(
nullptr
),
_type
(
0
)
{}
size_t
_size
;
void
*
_target
;
char
_type
;
...
...
@@ -31,7 +32,7 @@ namespace NDDSClient {
class
CCellInputMap
{
public
:
CCellInputMap
();
void
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
const
unsigned
in
t
_BufferSize
,
char
_BufferType
);
void
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
size_
t
_BufferSize
,
char
_BufferType
);
void
ReadInputElements
();
private
:
typedef
std
::
unique_ptr
<
CellInput
>
TCellRef
;
...
...
@@ -57,7 +58,7 @@ namespace NDDSClient {
class
CCellOutputMap
{
public
:
CCellOutputMap
()
{}
void
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
const
unsigned
in
t
_BufferSize
,
char
_BufferType
);
void
RegInpElem
(
std
::
string
name
,
void
*
_pBuffer
,
size_
t
_BufferSize
,
char
_BufferType
);
void
WriteOutputElements
();
private
:
typedef
std
::
unique_ptr
<
CellOutput
>
TCellRef
;
...
...
include/NadsDDSLib/NadsDDSLib.h
View file @
cfc71463
...
...
@@ -23,6 +23,32 @@
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_32ds.lib")
#endif
#else
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_64ds.lib")
#endif
#endif // DEBUG
#else
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_32s.lib")
#endif
#else
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_64s.lib")
#endif
#endif // DEBUG
#endif
#endif
#endif
#ifndef NO_AUTOLINK_DDS_LIB
#ifdef _MSC_VER
#pragma comment(lib, "Ws2_32.lib")
#ifdef _DEBUG
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"nddscpp2zd.lib")
#pragma comment(lib,"nddsczd.lib")
#pragma comment(lib,"nddscorezd.lib")
...
...
@@ -32,7 +58,6 @@
#endif
#else
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_64ds.lib")
#pragma comment(lib,"nddscpp2zd.lib")
#pragma comment(lib,"nddsczd.lib")
#pragma comment(lib,"nddscorezd.lib")
...
...
@@ -44,7 +69,6 @@
#else
#ifdef _X86_
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_32s.lib")
#pragma comment(lib,"nddscpp2z.lib")
#pragma comment(lib,"nddscz.lib")
#pragma comment(lib,"nddscorez.lib")
...
...
@@ -54,7 +78,6 @@
#endif
#else
#ifndef NADSDDDS_DLL
#pragma comment(lib,"NadsDDSLib_64s.lib")
#pragma comment(lib,"nddscpp2z.lib")
#pragma comment(lib,"nddscz.lib")
#pragma comment(lib,"nddscorez.lib")
...
...
@@ -86,7 +109,7 @@ namespace NADSDDS {
class
CellRoot
{
public
:
CellRoot
(
int
id
)
:
_eid
(
id
),
_itemCount
(
0
),
_period
(
-
1
)
{
CellRoot
(
int
id
)
:
_eid
(
id
),
_itemCount
(
0
),
_period
(
-
1
)
,
_sizeInBytes
(
0
)
{
}
virtual
void
*
Raw
()
=
0
;
virtual
void
Send
()
=
0
;
...
...
src/nadsddsimpl.cpp
View file @
cfc71463
...
...
@@ -110,7 +110,7 @@ namespace NADSDDS {
}
CStatePriv
::
CStatePriv
()
{
CStatePriv
::
CStatePriv
()
:
_frame
(
0
)
{
_newFrameCb
=
make_shared
<
CStatePriv
::
OnNewFrame
>
(
this
);
_FrameSub
=
std
::
make_unique
<
DataStream
<
TypeInt
>>
(
"Frame"
,
&
DDSDomainRepo
::
GetDomain
(
0
),
_newFrameCb
);
_StateSub
=
std
::
make_unique
<
TIntSubscription
>
(
"StateMode"
);
...
...
src/nadsddsimpl.h
View file @
cfc71463
...
...
@@ -134,7 +134,7 @@ namespace NADSDDS {
public
:
typedef
unique_ptr
<
CellPub
<
TypeFloat
>>
TRef
;
CFloatPub
(
TRef
&&
in
)
:
_ref
(
std
::
move
(
in
))
{};
CFloatPub
(
CFloatPub
&&
in
)
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
CFloatPub
(
CFloatPub
&&
in
)
noexcept
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
TRef
_ref
;
CellPub
<
TypeFloat
>*
get
()
{
return
_ref
.
get
();
}
CellPub
<
TypeFloat
>*
operator
->
()
{
return
_ref
.
get
();
}
...
...
@@ -153,7 +153,7 @@ namespace NADSDDS {
public
:
typedef
unique_ptr
<
CellPub
<
TypeDouble
>>
TRef
;
CDoublePub
(
TRef
&&
in
)
:
_ref
(
std
::
move
(
in
))
{};
CDoublePub
(
CDoublePub
&&
in
)
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
CDoublePub
(
CDoublePub
&&
in
)
noexcept
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
TRef
_ref
;
CellPub
<
TypeDouble
>*
get
()
{
return
_ref
.
get
();
}
CellPub
<
TypeDouble
>*
operator
->
()
{
return
_ref
.
get
();
}
...
...
@@ -172,7 +172,7 @@ namespace NADSDDS {
public
:
typedef
unique_ptr
<
CellPub
<
TypeChar
>>
TRef
;
CCharPub
(
TRef
&&
in
)
:
_ref
(
std
::
move
(
in
))
{};
CCharPub
(
CCharPub
&&
in
)
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
CCharPub
(
CCharPub
&&
in
)
noexcept
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
TRef
_ref
;
CellPub
<
TypeChar
>*
get
()
{
return
_ref
.
get
();
}
CellPub
<
TypeChar
>*
operator
->
()
{
return
_ref
.
get
();
}
...
...
@@ -193,7 +193,7 @@ namespace NADSDDS {
public
:
typedef
unique_ptr
<
CellPub
<
TypeInt
>>
TRef
;
CIntPub
(
TRef
&&
in
)
:
_ref
(
std
::
move
(
in
))
{};
CIntPub
(
CIntPub
&&
in
)
:
_ref
(
std
::
move
(
in
.
_ref
)){}
CIntPub
(
CIntPub
&&
in
)
noexcept
:
_ref
(
std
::
move
(
in
.
_ref
)){}
TRef
_ref
;
CellPub
<
TypeInt
>*
get
()
{
return
_ref
.
get
();
}
CellPub
<
TypeInt
>*
operator
->
()
{
return
_ref
.
get
();
}
...
...
@@ -212,7 +212,7 @@ namespace NADSDDS {
public
:
typedef
unique_ptr
<
CellPub
<
TypeShort
>>
TRef
;
CShortPub
(
TRef
&&
in
)
:
_ref
(
std
::
move
(
in
))
{};
CShortPub
(
CShortPub
&&
in
)
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
CShortPub
(
CShortPub
&&
in
)
noexcept
:
_ref
(
std
::
move
(
in
.
_ref
))
{}
operator
CellPub
<
TypeShort
>*
()
{
return
_ref
.
get
();
}
CellPub
<
TypeShort
>*
operator
()()
{
return
_ref
.
get
();
}
TRef
_ref
;
...
...
@@ -249,7 +249,7 @@ namespace NADSDDS {
template
<
class
T
>
class
DataListener
:
public
dds
::
sub
::
NoOpDataReaderListener
<
T
>
{
public
:
typedef
std
::
shared_ptr
<
OnNewData
<
T
>>
TCbRef
;
DataListener
(
TCbRef
ref
)
:
_cb
(
ref
)
{};
DataListener
(
TCbRef
ref
)
:
_cb
(
ref
)
,
_hasData
(
false
)
{};
void
on_data_available
(
dds
::
sub
::
DataReader
<
T
>&
reader
)
{
dds
::
sub
::
LoanedSamples
<
T
>
samples
=
reader
.
take
();
rti
::
sub
::
SampleIterator
<
T
>
it
;
// = dds::sub::LoanedSamples<T>::iterator
...
...
src/nadsddslib.cpp
View file @
cfc71463
...
...
@@ -73,7 +73,7 @@ void DoublePublication::Set(const std::string& str){
stringstream
converter
(
str
);
double
val
;
converter
>>
val
;
in
t
size
=
Count
();
size_
t
size
=
Count
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
converter
>>
val
;
(
*
this
)[
i
]
=
val
;
...
...
@@ -129,7 +129,7 @@ void FloatPublication::Set(const std::string& str) {
stringstream
converter
(
str
);
float
val
;
converter
>>
val
;
in
t
size
=
Count
();
size_
t
size
=
Count
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
converter
>>
val
;
(
*
this
)[
i
]
=
val
;
...
...
@@ -164,7 +164,7 @@ void ShortPublication::Set(const std::string& str) {
stringstream
converter
(
str
);
short
val
;
converter
>>
val
;
in
t
size
=
Count
();
size_
t
size
=
Count
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
converter
>>
val
;
(
*
this
)[
i
]
=
val
;
...
...
@@ -192,7 +192,7 @@ void IntPublication::Set(const std::string& str) {
stringstream
converter
(
str
);
int
val
;
converter
>>
val
;
in
t
size
=
Count
();
size_
t
size
=
Count
();
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
converter
>>
val
;
(
*
this
)[
i
]
=
val
;
...
...
@@ -227,7 +227,7 @@ char& CharPublication::operator[] (size_t index) {
}
void
CharPublication
::
Set
(
const
std
::
string
&
str
)
{;
in
t
size
=
min
(
Count
(),
str
.
size
());
size_
t
size
=
min
(
Count
(),
str
.
size
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
{
(
*
this
)[
i
]
=
str
[
i
];
}
...
...
stdafx.h
View file @
cfc71463
No preview for this file type
targetver.h
View file @
cfc71463
No preview for this file type
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