Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
130
Issues
130
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
38b92733
Commit
38b92733
authored
Apr 03, 2019
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
clang-tidy: fix issues
Change-Id: Ic4514b6e68346cd8488ccf750796c8590cee653a
parent
3b7f1513
Changes
18
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
65 additions
and
95 deletions
+65
-95
src/account.cpp
src/account.cpp
+2
-2
src/account.h
src/account.h
+1
-1
src/archiver.cpp
src/archiver.cpp
+12
-15
src/archiver.h
src/archiver.h
+4
-4
src/manager.cpp
src/manager.cpp
+11
-12
src/media/media_codec.cpp
src/media/media_codec.cpp
+6
-19
src/media/media_codec.h
src/media/media_codec.h
+8
-9
src/media/media_encoder.cpp
src/media/media_encoder.cpp
+2
-0
src/media/system_codec_container.cpp
src/media/system_codec_container.cpp
+3
-3
src/media/system_codec_container.h
src/media/system_codec_container.h
+1
-1
src/media/video/video_rtp_session.cpp
src/media/video/video_rtp_session.cpp
+2
-2
src/media/video/video_sender.cpp
src/media/video/video_sender.cpp
+1
-1
src/ringdht/ringaccount.cpp
src/ringdht/ringaccount.cpp
+1
-3
src/ringdht/ringaccount.h
src/ringdht/ringaccount.h
+1
-1
src/sip/sdp.cpp
src/sip/sdp.cpp
+0
-1
src/sip/sipaccount.cpp
src/sip/sipaccount.cpp
+5
-8
src/threadloop.cpp
src/threadloop.cpp
+0
-10
src/threadloop.h
src/threadloop.h
+5
-3
No files found.
src/account.cpp
View file @
38b92733
...
...
@@ -492,11 +492,11 @@ Account::searchCodecById(unsigned codecId, MediaType mediaType)
}
std
::
shared_ptr
<
AccountCodecInfo
>
Account
::
searchCodecByName
(
std
::
string
name
,
MediaType
mediaType
)
Account
::
searchCodecByName
(
const
std
::
string
&
name
,
MediaType
mediaType
)
{
if
(
mediaType
!=
MEDIA_NONE
)
{
for
(
auto
&
codecIt
:
accountCodecInfoList_
)
{
if
(
(
codecIt
->
systemCodecInfo
.
name
.
compare
(
name
)
==
0
)
&&
if
(
codecIt
->
systemCodecInfo
.
name
==
name
&&
(
codecIt
->
systemCodecInfo
.
mediaType
&
mediaType
))
return
codecIt
;
}
...
...
src/account.h
View file @
38b92733
...
...
@@ -486,7 +486,7 @@ class Account : public Serializable, public std::enable_shared_from_this<Account
/**
* private account codec searching functions
*/
std
::
shared_ptr
<
AccountCodecInfo
>
searchCodecByName
(
std
::
string
name
,
MediaType
mediaType
);
std
::
shared_ptr
<
AccountCodecInfo
>
searchCodecByName
(
const
std
::
string
&
name
,
MediaType
mediaType
);
std
::
vector
<
unsigned
>
getAccountCodecInfoIdList
(
MediaType
mediaType
)
const
;
void
setAllCodecsActive
(
MediaType
mediaType
,
bool
active
);
};
...
...
src/archiver.cpp
View file @
38b92733
...
...
@@ -66,32 +66,29 @@ jsonValueToAccount(Json::Value& value, const std::string& accountId) {
}
Json
::
Value
accountToJsonValue
(
std
::
map
<
std
::
string
,
std
::
string
>
details
)
{
accountToJsonValue
(
const
std
::
map
<
std
::
string
,
std
::
string
>&
details
)
{
Json
::
Value
root
;
std
::
map
<
std
::
string
,
std
::
string
>::
iterator
iter
;
for
(
iter
=
details
.
begin
();
iter
!=
details
.
end
();
++
iter
)
{
if
(
iter
->
first
.
compare
(
DRing
::
Account
::
ConfProperties
::
Ringtone
::
PATH
)
==
0
)
{
for
(
const
auto
&
i
:
details
)
{
if
(
i
.
first
==
DRing
::
Account
::
ConfProperties
::
Ringtone
::
PATH
)
{
// Ringtone path is not exportable
}
else
if
(
i
ter
->
first
.
compare
(
DRing
::
Account
::
ConfProperties
::
TLS
::
CA_LIST_FILE
)
==
0
||
iter
->
first
.
compare
(
DRing
::
Account
::
ConfProperties
::
TLS
::
CERTIFICATE_FILE
)
==
0
||
iter
->
first
.
compare
(
DRing
::
Account
::
ConfProperties
::
TLS
::
PRIVATE_KEY_FILE
)
==
0
)
{
}
else
if
(
i
.
first
==
DRing
::
Account
::
ConfProperties
::
TLS
::
CA_LIST_FILE
||
i
.
first
==
DRing
::
Account
::
ConfProperties
::
TLS
::
CERTIFICATE_FILE
||
i
.
first
==
DRing
::
Account
::
ConfProperties
::
TLS
::
PRIVATE_KEY_FILE
)
{
// replace paths by the files content
std
::
ifstream
ifs
(
i
ter
->
second
);
std
::
ifstream
ifs
(
i
.
second
);
std
::
string
fileContent
((
std
::
istreambuf_iterator
<
char
>
(
ifs
)),
std
::
istreambuf_iterator
<
char
>
());
root
[
iter
->
first
]
=
fileContent
;
root
[
i
.
first
]
=
fileContent
;
}
else
root
[
i
ter
->
first
]
=
iter
->
second
;
root
[
i
.
first
]
=
i
.
second
;
}
return
root
;
}
int
exportAccounts
(
std
::
vector
<
std
::
string
>
accountIDs
,
std
::
string
filepath
,
std
::
string
password
)
exportAccounts
(
const
std
::
vector
<
std
::
string
>&
accountIDs
,
const
std
::
string
&
filepath
,
const
std
::
string
&
password
)
{
if
(
filepath
.
empty
()
||
!
accountIDs
.
size
())
{
JAMI_ERR
(
"Missing arguments"
);
...
...
src/archiver.h
View file @
38b92733
...
...
@@ -40,9 +40,9 @@ namespace archiver {
* @param password The mandatory password to set on the archive
* @returns 0 for OK, error code otherwise
*/
int
exportAccounts
(
std
::
vector
<
std
::
string
>
accountIDs
,
std
::
string
filepath
,
std
::
string
password
);
int
exportAccounts
(
const
std
::
vector
<
std
::
string
>&
accountIDs
,
const
std
::
string
&
filepath
,
const
std
::
string
&
password
);
/**
* Read a protected archive and add accounts found in it
...
...
@@ -51,7 +51,7 @@ int exportAccounts(std::vector<std::string> accountIDs,
* @param password The password to read the archive
* @returns 0 for OK, error code otherwise
*/
int
importAccounts
(
std
::
string
archivePath
,
std
::
string
password
);
int
importAccounts
(
const
std
::
string
&
archivePath
,
const
std
::
string
&
password
);
/**
* Compress a STL string using zlib with given compression level and return
...
...
src/manager.cpp
View file @
38b92733
...
...
@@ -1508,10 +1508,9 @@ Manager::createConfFromParticipantList(const std::vector< std::string > &partici
int
successCounter
=
0
;
for
(
const
auto
&
p
:
participantList
)
{
std
::
string
numberaccount
(
p
);
std
::
string
tostr
(
numberaccount
.
substr
(
0
,
numberaccount
.
find
(
","
)));
std
::
string
account
(
numberaccount
.
substr
(
numberaccount
.
find
(
","
)
+
1
,
numberaccount
.
size
()));
for
(
const
auto
&
numberaccount
:
participantList
)
{
std
::
string
tostr
(
numberaccount
.
substr
(
0
,
numberaccount
.
find
(
','
)));
std
::
string
account
(
numberaccount
.
substr
(
numberaccount
.
find
(
','
)
+
1
,
numberaccount
.
size
()));
pimpl_
->
unsetCurrentCall
();
...
...
@@ -1652,7 +1651,7 @@ Manager::joinConference(const std::string& conf_id1,
void
Manager
::
addAudio
(
Call
&
call
)
{
const
auto
call_id
=
call
.
getCallId
();
const
auto
&
call_id
=
call
.
getCallId
();
if
(
isConferenceParticipant
(
call_id
))
{
JAMI_DBG
(
"[conf:%s] Attach local audio"
,
call_id
.
c_str
());
...
...
@@ -1683,7 +1682,7 @@ Manager::addAudio(Call& call)
void
Manager
::
removeAudio
(
Call
&
call
)
{
const
auto
call_id
=
call
.
getCallId
();
const
auto
&
call_id
=
call
.
getCallId
();
JAMI_DBG
(
"[call:%s] Remove local audio"
,
call_id
.
c_str
());
getRingBufferPool
().
unBindAll
(
call_id
);
}
...
...
@@ -1992,7 +1991,7 @@ Manager::sendCallTextMessage(const std::string& callID,
void
Manager
::
peerAnsweredCall
(
Call
&
call
)
{
const
auto
call_id
=
call
.
getCallId
();
const
auto
&
call_id
=
call
.
getCallId
();
JAMI_DBG
(
"[call:%s] Peer answered"
,
call_id
.
c_str
());
// The if statement is useful only if we sent two calls at the same time.
...
...
@@ -2025,7 +2024,7 @@ Manager::peerRingingCall(Call& call)
void
Manager
::
peerHungupCall
(
Call
&
call
)
{
const
auto
call_id
=
call
.
getCallId
();
const
auto
&
call_id
=
call
.
getCallId
();
JAMI_DBG
(
"[call:%s] Peer hungup"
,
call_id
.
c_str
());
if
(
isConferenceParticipant
(
call_id
))
{
...
...
@@ -2065,7 +2064,7 @@ Manager::callBusy(Call& call)
void
Manager
::
callFailure
(
Call
&
call
)
{
const
auto
call_id
=
call
.
getCallId
();
const
auto
&
call_id
=
call
.
getCallId
();
JAMI_DBG
(
"[call:%s] Failed"
,
call
.
getCallId
().
c_str
());
if
(
isCurrentCall
(
call
))
{
...
...
@@ -2161,7 +2160,7 @@ Manager::playRingtone(const std::string& accountID)
std
::
string
ringchoice
=
account
->
getRingtonePath
();
#ifndef _WIN32
if
(
ringchoice
.
find
(
DIR_SEPARATOR_
STR
)
==
std
::
string
::
npos
)
{
if
(
ringchoice
.
find
(
DIR_SEPARATOR_
CH
)
==
std
::
string
::
npos
)
{
// check inside global share directory
static
const
char
*
const
RINGDIR
=
"ringtones"
;
ringchoice
=
std
::
string
(
PROGSHAREDIR
)
+
DIR_SEPARATOR_STR
...
...
@@ -2897,7 +2896,7 @@ std::vector<std::string>
Manager
::
getCallList
()
const
{
std
::
vector
<
std
::
string
>
results
;
for
(
auto
call
:
callFactory
.
getAllCalls
())
{
for
(
const
auto
&
call
:
callFactory
.
getAllCalls
())
{
if
(
!
call
->
isSubcall
())
results
.
push_back
(
call
->
getCallId
());
}
...
...
@@ -3047,7 +3046,7 @@ int
Manager
::
getMessageStatus
(
uint64_t
id
)
const
{
const
auto
&
allAccounts
=
accountFactory
.
getAllAccounts
();
for
(
auto
acc
:
allAccounts
)
{
for
(
const
auto
&
acc
:
allAccounts
)
{
auto
status
=
acc
->
getMessageStatus
(
id
);
if
(
status
!=
im
::
MessageStatus
::
UNKNOWN
)
return
statusFromImStatus
(
status
);
...
...
src/media/media_codec.cpp
View file @
38b92733
...
...
@@ -40,8 +40,8 @@ generateId()
/*
* SystemCodecInfo
*/
SystemCodecInfo
::
SystemCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
name
,
std
::
string
libName
,
SystemCodecInfo
::
SystemCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
&
name
,
const
std
::
string
&
libName
,
MediaType
mediaType
,
CodecType
codecType
,
unsigned
bitrate
,
unsigned
payloadType
,
...
...
@@ -66,8 +66,8 @@ SystemCodecInfo::~SystemCodecInfo()
* SystemAudioCodecInfo
*/
SystemAudioCodecInfo
::
SystemAudioCodecInfo
(
unsigned
m_avcodecId
,
const
std
::
string
m_name
,
std
::
string
m_libName
,
const
std
::
string
&
m_name
,
const
std
::
string
&
m_libName
,
CodecType
m_type
,
unsigned
m_bitrate
,
unsigned
m_sampleRate
,
unsigned
m_nbChannels
,
...
...
@@ -96,8 +96,8 @@ SystemAudioCodecInfo::getCodecSpecifications()
* SystemVideoCodecInfo
*/
SystemVideoCodecInfo
::
SystemVideoCodecInfo
(
unsigned
m_avcodecId
,
const
std
::
string
m_name
,
std
::
string
m_libName
,
const
std
::
string
&
m_name
,
const
std
::
string
&
m_libName
,
CodecType
m_type
,
unsigned
m_bitrate
,
unsigned
m_minQuality
,
...
...
@@ -137,19 +137,6 @@ AccountCodecInfo::AccountCodecInfo(const SystemCodecInfo& sysCodecInfo) noexcept
quality
=
SystemCodecInfo
::
DEFAULT_NO_QUALITY
;
}
AccountCodecInfo
&
AccountCodecInfo
::
operator
=
(
AccountCodecInfo
&&
o
)
{
if
(
&
systemCodecInfo
!=
&
o
.
systemCodecInfo
)
throw
std
::
runtime_error
(
"cannot assign codec info object pointing to another codec."
);
order
=
o
.
order
;
isActive
=
o
.
isActive
;
payloadType
=
o
.
payloadType
;
bitrate
=
o
.
bitrate
;
quality
=
o
.
quality
;
return
*
this
;
}
AccountCodecInfo
&
AccountCodecInfo
::
operator
=
(
const
AccountCodecInfo
&
o
)
{
...
...
src/media/media_codec.h
View file @
38b92733
...
...
@@ -73,8 +73,8 @@ struct SystemCodecInfo
static
constexpr
unsigned
DEFAULT_MIN_BITRATE
{
250
};
static
constexpr
unsigned
DEFAULT_MAX_BITRATE
{
3000
};
SystemCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
name
,
std
::
string
libName
,
MediaType
mediaType
,
SystemCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
&
name
,
const
std
::
string
&
libName
,
MediaType
mediaType
,
CodecType
codecType
=
CODEC_NONE
,
unsigned
bitrate
=
0
,
unsigned
payloadType
=
0
,
unsigned
m_minQuality
=
DEFAULT_NO_QUALITY
,
...
...
@@ -106,8 +106,8 @@ struct SystemCodecInfo
*/
struct
SystemAudioCodecInfo
:
SystemCodecInfo
{
SystemAudioCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
name
,
std
::
string
libName
,
CodecType
type
,
SystemAudioCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
&
name
,
const
std
::
string
&
libName
,
CodecType
type
,
unsigned
bitrate
=
0
,
unsigned
sampleRate
=
0
,
unsigned
nbChannels
=
0
,
unsigned
payloadType
=
0
);
...
...
@@ -126,8 +126,8 @@ struct SystemAudioCodecInfo : SystemCodecInfo
*/
struct
SystemVideoCodecInfo
:
SystemCodecInfo
{
SystemVideoCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
name
,
std
::
string
libName
,
CodecType
type
=
CODEC_NONE
,
SystemVideoCodecInfo
(
unsigned
avcodecId
,
const
std
::
string
&
name
,
const
std
::
string
&
libName
,
CodecType
type
=
CODEC_NONE
,
unsigned
bitrate
=
0
,
unsigned
m_minQuality
=
0
,
unsigned
m_maxQuality
=
0
,
...
...
@@ -153,9 +153,9 @@ struct AccountCodecInfo
{
AccountCodecInfo
(
const
SystemCodecInfo
&
sysCodecInfo
)
noexcept
;
AccountCodecInfo
(
const
AccountCodecInfo
&
)
noexcept
=
default
;
AccountCodecInfo
(
AccountCodecInfo
&&
)
noexcept
=
de
fault
;
AccountCodecInfo
(
AccountCodecInfo
&&
)
noexcept
=
de
lete
;
AccountCodecInfo
&
operator
=
(
const
AccountCodecInfo
&
);
AccountCodecInfo
&
operator
=
(
AccountCodecInfo
&&
);
AccountCodecInfo
&
operator
=
(
AccountCodecInfo
&&
)
noexcept
=
delete
;
const
SystemCodecInfo
&
systemCodecInfo
;
unsigned
order
{
0
};
/*used to define preferred codec list order in UI*/
...
...
@@ -165,7 +165,6 @@ struct AccountCodecInfo
unsigned
bitrate
;
unsigned
quality
;
std
::
map
<
std
::
string
,
std
::
string
>
getCodecSpecifications
();
};
struct
AccountAudioCodecInfo
:
AccountCodecInfo
...
...
src/media/media_encoder.cpp
View file @
38b92733
...
...
@@ -458,6 +458,8 @@ MediaEncoder::encodeAudio(AudioFrame& frame)
int
MediaEncoder
::
encode
(
AVFrame
*
frame
,
int
streamIdx
)
{
if
(
not
frame
)
return
-
1
;
if
(
!
initialized_
)
{
// Initialize on first video frame, or first audio frame if no video stream
bool
isVideo
=
(
frame
->
width
>
0
&&
frame
->
height
>
0
);
...
...
src/media/system_codec_container.cpp
View file @
38b92733
...
...
@@ -196,11 +196,11 @@ SystemCodecContainer::searchCodecById(unsigned codecId, MediaType mediaType)
return
{};
}
std
::
shared_ptr
<
SystemCodecInfo
>
SystemCodecContainer
::
searchCodecByName
(
std
::
string
name
,
MediaType
mediaType
)
SystemCodecContainer
::
searchCodecByName
(
const
std
::
string
&
name
,
MediaType
mediaType
)
{
for
(
const
auto
&
codecIt
:
availableCodecList_
)
{
if
(
(
codecIt
->
name
.
compare
(
name
)
==
0
)
&&
(
codecIt
->
mediaType
&
mediaType
))
if
(
codecIt
->
name
==
name
&&
(
codecIt
->
mediaType
&
mediaType
))
return
codecIt
;
}
return
{};
...
...
src/media/system_codec_container.h
View file @
38b92733
...
...
@@ -50,7 +50,7 @@ class SystemCodecContainer
searchCodecById
(
unsigned
codecId
,
MediaType
type
=
MEDIA_ALL
);
std
::
shared_ptr
<
SystemCodecInfo
>
searchCodecByName
(
std
::
string
name
,
MediaType
type
=
MEDIA_ALL
);
searchCodecByName
(
const
std
::
string
&
name
,
MediaType
type
=
MEDIA_ALL
);
std
::
shared_ptr
<
SystemCodecInfo
>
searchCodecByPayload
(
unsigned
payload
,
MediaType
type
=
MEDIA_ALL
);
...
...
src/media/video/video_rtp_session.cpp
View file @
38b92733
...
...
@@ -80,7 +80,7 @@ VideoRtpSession::updateMedia(const MediaDescription& send, const MediaDescriptio
void
VideoRtpSession
::
setRequestKeyFrameCallback
(
std
::
function
<
void
(
void
)
>
cb
)
{
requestKeyFrameCallback_
=
cb
;
requestKeyFrameCallback_
=
std
::
move
(
cb
)
;
}
void
VideoRtpSession
::
startSender
()
...
...
@@ -611,7 +611,7 @@ VideoRtpSession::deinitRecorder(std::shared_ptr<MediaRecorder>& rec)
void
VideoRtpSession
::
setChangeOrientationCallback
(
std
::
function
<
void
(
int
)
>
cb
)
{
changeOrientationCallback_
=
cb
;
changeOrientationCallback_
=
std
::
move
(
cb
)
;
}
}}
// namespace jami::video
src/media/video/video_sender.cpp
View file @
38b92733
...
...
@@ -144,7 +144,7 @@ VideoSender::useCodec(const jami::AccountVideoCodecInfo* codec) const
void
VideoSender
::
setChangeOrientationCallback
(
std
::
function
<
void
(
int
)
>
cb
)
{
changeOrientationCallback_
=
cb
;
changeOrientationCallback_
=
std
::
move
(
cb
)
;
}
}}
// namespace jami::video
src/ringdht/ringaccount.cpp
View file @
38b92733
...
...
@@ -88,8 +88,6 @@
namespace
jami
{
using
sip_utils
::
CONST_PJ_STR
;
namespace
Migration
{
enum
class
State
{
// Contains all the Migration states
...
...
@@ -2859,7 +2857,7 @@ RingAccount::loadValues() const
}
tls
::
DhParams
RingAccount
::
loadDhParams
(
const
std
::
string
path
)
RingAccount
::
loadDhParams
(
std
::
string
path
)
{
try
{
// writeTime throw exception if file doesn't exist
...
...
src/ringdht/ringaccount.h
View file @
38b92733
...
...
@@ -603,7 +603,7 @@ class RingAccount : public SIPAccountBase {
const
std
::
shared_ptr
<
dht
::
crypto
::
Certificate
>&
from_cert
,
const
dht
::
InfoHash
&
from
);
static
tls
::
DhParams
loadDhParams
(
const
std
::
string
path
);
static
tls
::
DhParams
loadDhParams
(
std
::
string
path
);
/**
* If privkeyPath_ is a valid private key file (PEM or DER),
...
...
src/sip/sdp.cpp
View file @
38b92733
...
...
@@ -50,7 +50,6 @@ using random_device = dht::crypto::random_device;
namespace
jami
{
using
std
::
string
;
using
std
::
map
;
using
std
::
vector
;
using
std
::
stringstream
;
...
...
src/sip/sipaccount.cpp
View file @
38b92733
...
...
@@ -1566,18 +1566,15 @@ void SIPAccount::keepAliveRegistrationCb(UNUSED pj_timer_heap_t *th, pj_timer_en
void
SIPAccount
::
Credentials
::
computePasswordHash
()
{
#define MD5_APPEND(pms,buf,len) pj_md5_update(pms, (const pj_uint8_t*)buf, len)
pj_md5_context
pms
;
/* Compute md5 hash = MD5(username ":" realm ":" password) */
pj_md5_init
(
&
pms
);
MD5_APPEND
(
&
pms
,
username
.
data
(),
username
.
length
());
MD5_APPEND
(
&
pms
,
":"
,
1
);
MD5_APPEND
(
&
pms
,
realm
.
data
(),
realm
.
length
());
MD5_APPEND
(
&
pms
,
":"
,
1
);
MD5_APPEND
(
&
pms
,
password
.
data
(),
password
.
length
());
#undef MD5_APPEND
pj_md5_update
(
&
pms
,
(
const
uint8_t
*
)
username
.
data
(),
username
.
length
());
pj_md5_update
(
&
pms
,
(
const
uint8_t
*
)
":"
,
1
);
pj_md5_update
(
&
pms
,
(
const
uint8_t
*
)
realm
.
data
(),
realm
.
length
());
pj_md5_update
(
&
pms
,
(
const
uint8_t
*
)
":"
,
1
);
pj_md5_update
(
&
pms
,
(
const
uint8_t
*
)
password
.
data
(),
password
.
length
());
unsigned
char
digest
[
16
];
pj_md5_final
(
&
pms
,
digest
);
...
...
src/threadloop.cpp
View file @
38b92733
...
...
@@ -57,16 +57,6 @@ ThreadLoop::ThreadLoop(const std::function<bool()>& setup,
,
thread_
()
{}
ThreadLoop
::
ThreadLoop
(
ThreadLoop
&&
other
)
:
setup_
(
std
::
move
(
other
.
setup_
))
,
process_
(
std
::
move
(
other
.
process_
))
,
cleanup_
(
std
::
move
(
other
.
cleanup_
))
,
state_
(
other
.
state_
.
load
())
,
thread_
(
std
::
move
(
other
.
thread_
))
{
other
.
state_
=
READY
;
}
ThreadLoop
::~
ThreadLoop
()
{
if
(
isRunning
())
{
...
...
src/threadloop.h
View file @
38b92733
...
...
@@ -41,9 +41,6 @@ public:
ThreadLoop
(
const
std
::
function
<
bool
()
>&
setup
,
const
std
::
function
<
void
()
>&
process
,
const
std
::
function
<
void
()
>&
cleanup
);
ThreadLoop
(
ThreadLoop
&&
);
virtual
~
ThreadLoop
();
void
start
();
...
...
@@ -57,6 +54,11 @@ public:
std
::
thread
::
id
get_id
()
const
noexcept
;
private:
ThreadLoop
(
const
ThreadLoop
&
)
=
delete
;
ThreadLoop
(
ThreadLoop
&&
)
noexcept
=
delete
;
ThreadLoop
&
operator
=
(
const
ThreadLoop
&
)
=
delete
;
ThreadLoop
&
operator
=
(
ThreadLoop
&&
)
noexcept
=
delete
;
// These must be provided by users of ThreadLoop
std
::
function
<
bool
()
>
setup_
;
std
::
function
<
void
()
>
process_
;
...
...
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