Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
44f4d5c6
Commit
44f4d5c6
authored
Jun 29, 2016
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix compile on GCC and runtime crash
parent
159aac50
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
16 additions
and
61 deletions
+16
-61
libcaf_core/caf/detail/memory.hpp
libcaf_core/caf/detail/memory.hpp
+2
-13
libcaf_core/caf/detail/memory_cache_flag_type.hpp
libcaf_core/caf/detail/memory_cache_flag_type.hpp
+0
-35
libcaf_core/caf/detail/parse_ini.hpp
libcaf_core/caf/detail/parse_ini.hpp
+3
-5
libcaf_core/caf/local_actor.hpp
libcaf_core/caf/local_actor.hpp
+0
-1
libcaf_core/src/actor_system_config.cpp
libcaf_core/src/actor_system_config.cpp
+4
-1
libcaf_core/src/parse_ini.cpp
libcaf_core/src/parse_ini.cpp
+7
-1
libcaf_core/test/parse_ini.cpp
libcaf_core/test/parse_ini.cpp
+0
-2
libcaf_io/caf/io/network/multiplexer.hpp
libcaf_io/caf/io/network/multiplexer.hpp
+0
-3
No files found.
libcaf_core/caf/detail/memory.hpp
View file @
44f4d5c6
...
@@ -30,7 +30,6 @@
...
@@ -30,7 +30,6 @@
#include "caf/ref_counted.hpp"
#include "caf/ref_counted.hpp"
#include "caf/detail/embedded.hpp"
#include "caf/detail/embedded.hpp"
#include "caf/detail/memory_cache_flag_type.hpp"
namespace
caf
{
namespace
caf
{
class
mailbox_element
;
class
mailbox_element
;
...
@@ -114,12 +113,7 @@ public:
...
@@ -114,12 +113,7 @@ public:
static_assert
(
dsize
>
0
,
"dsize == 0"
);
static_assert
(
dsize
>
0
,
"dsize == 0"
);
using
embedded_t
=
using
embedded_t
=
embedded
<
T
>
;
typename
std
::
conditional
<
T
::
memory_cache_flag
==
needs_embedding
,
embedded
<
T
>
,
T
>::
type
;
struct
wrapper
{
struct
wrapper
{
union
{
union
{
...
@@ -192,12 +186,7 @@ public:
...
@@ -192,12 +186,7 @@ public:
// Allocates storage, initializes a new object, and returns the new instance.
// Allocates storage, initializes a new object, and returns the new instance.
template
<
class
T
,
class
...
Ts
>
template
<
class
T
,
class
...
Ts
>
static
T
*
create
(
Ts
&&
...
xs
)
{
static
T
*
create
(
Ts
&&
...
xs
)
{
using
embedded_t
=
using
embedded_t
=
embedded
<
T
>
;
typename
std
::
conditional
<
T
::
memory_cache_flag
==
needs_embedding
,
embedded
<
T
>
,
T
>::
type
;
auto
mc
=
get_or_set_cache_map_entry
<
T
>
();
auto
mc
=
get_or_set_cache_map_entry
<
T
>
();
auto
es
=
mc
->
new_embedded_storage
();
auto
es
=
mc
->
new_embedded_storage
();
auto
ptr
=
reinterpret_cast
<
embedded_t
*>
(
es
.
second
);
auto
ptr
=
reinterpret_cast
<
embedded_t
*>
(
es
.
second
);
...
...
libcaf_core/caf/detail/memory_cache_flag_type.hpp
deleted
100644 → 0
View file @
159aac50
/******************************************************************************
* ____ _ _____ *
* / ___| / \ | ___| C++ *
* | | / _ \ | |_ Actor *
* | |___ / ___ \| _| Framework *
* \____/_/ \_|_| *
* *
* Copyright (C) 2011 - 2015 *
* Dominik Charousset <dominik.charousset (at) haw-hamburg.de> *
* *
* Distributed under the terms and conditions of the BSD 3-Clause License or *
* (at your option) under the terms and conditions of the Boost Software *
* License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. *
* *
* If you did not receive a copy of the license files, see *
* http://opensource.org/licenses/BSD-3-Clause and *
* http://www.boost.org/LICENSE_1_0.txt. *
******************************************************************************/
#ifndef CAF_DETAIL_MEMORY_CACHE_FLAG_TYPE_HPP
#define CAF_DETAIL_MEMORY_CACHE_FLAG_TYPE_HPP
namespace
caf
{
namespace
detail
{
enum
memory_cache_flag_type
{
needs_embedding
,
provides_embedding
};
}
// namespace detail
}
// namespace caf
#endif // CAF_DETAIL_MEMORY_CACHE_FLAG_TYPE_HPP
libcaf_core/caf/detail/parse_ini.hpp
View file @
44f4d5c6
...
@@ -25,18 +25,16 @@
...
@@ -25,18 +25,16 @@
#include <functional>
#include <functional>
#include "caf/atom.hpp"
#include "caf/atom.hpp"
#include "caf/optional.hpp"
#include "caf/variant.hpp"
#include "caf/variant.hpp"
#include "caf/optional.hpp"
#include "caf/config_value.hpp"
namespace
caf
{
namespace
caf
{
namespace
detail
{
namespace
detail
{
struct
parse_ini_t
{
struct
parse_ini_t
{
/// Denotes a configuration value.
using
value
=
variant
<
std
::
string
,
double
,
int64_t
,
bool
,
atom_value
>
;
/// Denotes a callback for consuming configuration values.
/// Denotes a callback for consuming configuration values.
using
config_consumer
=
std
::
function
<
void
(
size_t
,
std
::
string
,
value
&
)
>
;
using
config_consumer
=
std
::
function
<
void
(
size_t
,
std
::
string
,
config_
value
&
)
>
;
/// Parse the given input stream as INI formatted data and
/// Parse the given input stream as INI formatted data and
/// calls the consumer with every key-value pair.
/// calls the consumer with every key-value pair.
...
...
libcaf_core/caf/local_actor.hpp
View file @
44f4d5c6
...
@@ -64,7 +64,6 @@
...
@@ -64,7 +64,6 @@
#include "caf/detail/behavior_stack.hpp"
#include "caf/detail/behavior_stack.hpp"
#include "caf/detail/typed_actor_util.hpp"
#include "caf/detail/typed_actor_util.hpp"
#include "caf/detail/single_reader_queue.hpp"
#include "caf/detail/single_reader_queue.hpp"
#include "caf/detail/memory_cache_flag_type.hpp"
namespace
caf
{
namespace
caf
{
...
...
libcaf_core/src/actor_system_config.cpp
View file @
44f4d5c6
...
@@ -213,7 +213,10 @@ actor_system_config& actor_system_config::parse(message& args,
...
@@ -213,7 +213,10 @@ actor_system_config& actor_system_config::parse(message& args,
// (2) content of the INI file overrides hard-coded defaults
// (2) content of the INI file overrides hard-coded defaults
if
(
ini
.
good
())
{
if
(
ini
.
good
())
{
actor_system_config_reader
consumer
{
options_
,
custom_options_
};
actor_system_config_reader
consumer
{
options_
,
custom_options_
};
detail
::
parse_ini
(
ini
,
consumer
,
std
::
cerr
);
auto
f
=
[
&
](
size_t
ln
,
std
::
string
str
,
config_value
&
x
)
{
consumer
(
ln
,
std
::
move
(
str
),
x
);
};
detail
::
parse_ini
(
ini
,
f
,
std
::
cerr
);
}
}
// (3) CLI options override the content of the INI file
// (3) CLI options override the content of the INI file
std
::
string
dummy
;
// caf#config-file either ignored or already open
std
::
string
dummy
;
// caf#config-file either ignored or already open
...
...
libcaf_core/src/parse_ini.cpp
View file @
44f4d5c6
...
@@ -29,24 +29,30 @@ namespace detail {
...
@@ -29,24 +29,30 @@ namespace detail {
void
parse_ini_t
::
operator
()(
std
::
istream
&
input
,
config_consumer
consumer_fun
,
void
parse_ini_t
::
operator
()(
std
::
istream
&
input
,
config_consumer
consumer_fun
,
optional
<
std
::
ostream
&>
errors
)
const
{
optional
<
std
::
ostream
&>
errors
)
const
{
printf
(
"%s %d
\n
"
,
__FILE__
,
__LINE__
);
// wraps a temporary into an (lvalue) config_value and calls `consumer_fun`
// wraps a temporary into an (lvalue) config_value and calls `consumer_fun`
auto
consumer
=
[
&
](
size_t
ln
,
std
::
string
name
,
value
x
)
{
auto
consumer
=
[
&
](
size_t
ln
,
std
::
string
name
,
config_
value
x
)
{
consumer_fun
(
ln
,
std
::
move
(
name
),
x
);
consumer_fun
(
ln
,
std
::
move
(
name
),
x
);
};
};
printf
(
"%s %d
\n
"
,
__FILE__
,
__LINE__
);
std
::
string
group
;
std
::
string
group
;
std
::
string
line
;
std
::
string
line
;
size_t
ln
=
0
;
// line number
size_t
ln
=
0
;
// line number
printf
(
"%s %d
\n
"
,
__FILE__
,
__LINE__
);
auto
print
=
[
&
](
const
char
*
category
,
const
char
*
str
)
{
auto
print
=
[
&
](
const
char
*
category
,
const
char
*
str
)
{
if
(
errors
)
if
(
errors
)
*
errors
<<
category
<<
" INI file line "
*
errors
<<
category
<<
" INI file line "
<<
ln
<<
": "
<<
str
<<
std
::
endl
;
<<
ln
<<
": "
<<
str
<<
std
::
endl
;
};
};
printf
(
"%s %d
\n
"
,
__FILE__
,
__LINE__
);
auto
print_error
=
[
&
](
const
char
*
str
)
{
auto
print_error
=
[
&
](
const
char
*
str
)
{
print
(
"[ERROR]"
,
str
);
print
(
"[ERROR]"
,
str
);
};
};
printf
(
"%s %d
\n
"
,
__FILE__
,
__LINE__
);
auto
print_warning
=
[
&
](
const
char
*
str
)
{
auto
print_warning
=
[
&
](
const
char
*
str
)
{
print
(
"[WARNING]"
,
str
);
print
(
"[WARNING]"
,
str
);
};
};
printf
(
"%s %d
\n
"
,
__FILE__
,
__LINE__
);
while
(
std
::
getline
(
input
,
line
))
{
while
(
std
::
getline
(
input
,
line
))
{
++
ln
;
++
ln
;
// get begin-of-line (bol) and end-of-line (eol), ignoring whitespaces
// get begin-of-line (bol) and end-of-line (eol), ignoring whitespaces
...
...
libcaf_core/test/parse_ini.cpp
View file @
44f4d5c6
...
@@ -91,8 +91,6 @@ public:
...
@@ -91,8 +91,6 @@ public:
}
}
};
};
using
config_value
=
detail
::
parse_ini_t
::
value
;
struct
config
:
actor_system_config
{
struct
config
:
actor_system_config
{
config
()
{
config
()
{
parse
(
test
::
engine
::
argc
(),
test
::
engine
::
argv
());
parse
(
test
::
engine
::
argc
(),
test
::
engine
::
argv
());
...
...
libcaf_io/caf/io/network/multiplexer.hpp
View file @
44f4d5c6
...
@@ -37,8 +37,6 @@
...
@@ -37,8 +37,6 @@
#include "caf/io/network/protocol.hpp"
#include "caf/io/network/protocol.hpp"
#include "caf/io/network/native_socket.hpp"
#include "caf/io/network/native_socket.hpp"
#include "caf/detail/memory_cache_flag_type.hpp"
namespace
boost
{
namespace
boost
{
namespace
asio
{
namespace
asio
{
class
io_service
;
class
io_service
;
...
@@ -144,7 +142,6 @@ public:
...
@@ -144,7 +142,6 @@ public:
template
<
class
F
>
template
<
class
F
>
void
post
(
F
fun
)
{
void
post
(
F
fun
)
{
struct
impl
:
runnable
{
struct
impl
:
runnable
{
//static constexpr auto memory_cache_flag = detail::needs_embedding;
F
f
;
F
f
;
impl
(
F
&&
mf
)
:
f
(
std
::
move
(
mf
))
{
}
impl
(
F
&&
mf
)
:
f
(
std
::
move
(
mf
))
{
}
resume_result
resume
(
execution_unit
*
,
size_t
)
override
{
resume_result
resume
(
execution_unit
*
,
size_t
)
override
{
...
...
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