Markopy
Utilizing Markov Models for brute forcing attacks
threadSharedListHandler.cpp
Go to the documentation of this file.
1
/** @file threadSharedListHandler.cpp
2
* @brief Thread-safe wrapper for std::ifstream
3
* @authors Ata Hakçıl
4
*
5
* @copydoc Markov::API::Concurrency::ThreadSharedListHandler
6
*
7
*/
8
9
#
include
"threadSharedListHandler.h"
10
11
12
Markov
::
API
::
Concurrency
::
ThreadSharedListHandler
::
ThreadSharedListHandler
(
const
char
* filename){
13
this
->
listfile
;
14
this
->
listfile
.open(filename, std::ios_base::binary);
15
}
16
17
18
bool
Markov
::
API
::
Concurrency
::
ThreadSharedListHandler
::
next
(std::string* line){
19
bool
res =
false
;
20
this
->
mlock
.lock();
21
res = (std::getline(
this
->
listfile
,*line,
'\n'
))?
true
:
false
;
22
this
->
mlock
.unlock();
23
24
return
res;
25
}
Markopy
MarkovAPI
src
threadSharedListHandler.cpp
Generated by
1.9.0