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
e3bce7a3
Commit
e3bce7a3
authored
Oct 30, 2011
by
neverlord
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
documentation folder
parent
e39416ae
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
261 additions
and
0 deletions
+261
-0
documentation/announce_example_1.cpp
documentation/announce_example_1.cpp
+56
-0
documentation/announce_example_2.cpp
documentation/announce_example_2.cpp
+61
-0
documentation/announce_example_3.cpp
documentation/announce_example_3.cpp
+68
-0
documentation/announce_example_4.cpp
documentation/announce_example_4.cpp
+76
-0
No files found.
documentation/announce_example_1.cpp
0 → 100644
View file @
e3bce7a3
#include <utility>
#include <iostream>
#include "cppa/cppa.hpp"
using
std
::
cout
;
using
std
::
endl
;
using
namespace
cppa
;
struct
foo
{
int
a
;
int
b
;
};
bool
operator
==
(
const
foo
&
lhs
,
const
foo
&
rhs
)
{
return
lhs
.
a
==
rhs
.
a
&&
lhs
.
b
==
rhs
.
b
;
}
typedef
std
::
pair
<
int
,
int
>
foo_pair
;
int
main
(
int
,
char
**
)
{
announce
<
foo
>
(
&
foo
::
a
,
&
foo
::
b
);
announce
<
foo_pair
>
(
&
foo_pair
::
first
,
&
foo_pair
::
second
);
send
(
self
(),
foo
{
1
,
2
});
send
(
self
(),
foo_pair
{
3
,
4
});
send
(
self
(),
atom
(
"done"
));
receive_loop
(
on
<
atom
(
"done"
)
>
()
>>
[]()
{
exit
(
0
);
},
on
<
foo_pair
>
()
>>
[](
const
foo_pair
&
val
)
{
cout
<<
"foo_pair("
<<
val
.
first
<<
","
<<
val
.
second
<<
")"
<<
endl
;
},
on
<
foo
>
()
>>
[](
const
foo
&
val
)
{
cout
<<
"foo("
<<
val
.
a
<<
","
<<
val
.
b
<<
")"
<<
endl
;
}
);
return
0
;
}
documentation/announce_example_2.cpp
0 → 100644
View file @
e3bce7a3
#include <utility>
#include <iostream>
#include "cppa/cppa.hpp"
using
std
::
cout
;
using
std
::
endl
;
using
std
::
make_pair
;
using
namespace
cppa
;
class
foo
{
int
m_a
;
int
m_b
;
public:
foo
()
:
m_a
(
0
),
m_b
(
0
)
{
}
foo
(
int
a0
,
int
b0
)
:
m_a
(
a0
),
m_b
(
b0
)
{
}
foo
(
const
foo
&
)
=
default
;
foo
&
operator
=
(
const
foo
&
)
=
default
;
int
a
()
const
{
return
m_a
;
}
void
set_a
(
int
val
)
{
m_a
=
val
;
}
int
b
()
const
{
return
m_b
;
}
void
set_b
(
int
val
)
{
m_b
=
val
;
}
};
bool
operator
==
(
const
foo
&
lhs
,
const
foo
&
rhs
)
{
return
lhs
.
a
()
==
rhs
.
a
()
&&
lhs
.
b
()
==
rhs
.
b
();
}
int
main
(
int
,
char
**
)
{
announce
<
foo
>
(
make_pair
(
&
foo
::
a
,
&
foo
::
set_a
),
make_pair
(
&
foo
::
b
,
&
foo
::
set_b
));
send
(
self
(),
foo
{
1
,
2
});
receive
(
on
<
foo
>
()
>>
[](
const
foo
&
val
)
{
cout
<<
"foo("
<<
val
.
a
()
<<
","
<<
val
.
b
()
<<
")"
<<
endl
;
}
);
return
0
;
}
documentation/announce_example_3.cpp
0 → 100644
View file @
e3bce7a3
#include <utility>
#include <iostream>
#include "cppa/cppa.hpp"
using
std
::
cout
;
using
std
::
endl
;
using
std
::
make_pair
;
using
namespace
cppa
;
class
foo
{
int
m_a
;
int
m_b
;
public:
foo
()
:
m_a
(
0
),
m_b
(
0
)
{
}
foo
(
int
a0
,
int
b0
)
:
m_a
(
a0
),
m_b
(
b0
)
{
}
foo
(
const
foo
&
)
=
default
;
foo
&
operator
=
(
const
foo
&
)
=
default
;
int
a
()
const
{
return
m_a
;
}
void
a
(
int
val
)
{
m_a
=
val
;
}
int
b
()
const
{
return
m_b
;
}
void
b
(
int
val
)
{
m_b
=
val
;
}
};
bool
operator
==
(
const
foo
&
lhs
,
const
foo
&
rhs
)
{
return
lhs
.
a
()
==
rhs
.
a
()
&&
lhs
.
b
()
==
rhs
.
b
();
}
typedef
int
(
foo
::*
foo_getter
)()
const
;
typedef
void
(
foo
::*
foo_setter
)(
int
);
int
main
(
int
,
char
**
)
{
foo_getter
g1
=
&
foo
::
a
;
foo_setter
s1
=
&
foo
::
a
;
foo_getter
g2
=
&
foo
::
b
;
foo_setter
s2
=
&
foo
::
b
;
announce
<
foo
>
(
make_pair
(
g1
,
s1
),
make_pair
(
g2
,
s2
));
send
(
self
(),
foo
{
1
,
2
});
receive
(
on
<
foo
>
()
>>
[](
const
foo
&
val
)
{
cout
<<
"foo("
<<
val
.
a
()
<<
","
<<
val
.
b
()
<<
")"
<<
endl
;
}
);
return
0
;
}
documentation/announce_example_4.cpp
0 → 100644
View file @
e3bce7a3
#include <utility>
#include <iostream>
#include "cppa/cppa.hpp"
using
std
::
cout
;
using
std
::
endl
;
using
std
::
make_pair
;
using
namespace
cppa
;
class
foo
{
int
m_a
;
int
m_b
;
public:
foo
()
:
m_a
(
0
),
m_b
(
0
)
{
}
foo
(
int
a0
,
int
b0
)
:
m_a
(
a0
),
m_b
(
b0
)
{
}
foo
(
const
foo
&
)
=
default
;
foo
&
operator
=
(
const
foo
&
)
=
default
;
int
a
()
const
{
return
m_a
;
}
void
set_a
(
int
val
)
{
m_a
=
val
;
}
int
b
()
const
{
return
m_b
;
}
void
set_b
(
int
val
)
{
m_b
=
val
;
}
};
bool
operator
==
(
const
foo
&
lhs
,
const
foo
&
rhs
)
{
return
lhs
.
a
()
==
rhs
.
a
()
&&
lhs
.
b
()
==
rhs
.
b
();
}
struct
bar
{
foo
f
;
int
i
;
};
bool
operator
==
(
const
bar
&
lhs
,
const
bar
&
rhs
)
{
return
lhs
.
f
==
rhs
.
f
&&
lhs
.
i
==
rhs
.
i
;
}
int
main
(
int
,
char
**
)
{
announce
<
bar
>
(
compound_member
(
&
bar
::
f
,
make_pair
(
&
foo
::
a
,
&
foo
::
set_a
),
make_pair
(
&
foo
::
b
,
&
foo
::
set_b
)),
&
bar
::
i
);
send
(
self
(),
bar
{
foo
{
1
,
2
},
3
});
receive
(
on
<
bar
>
()
>>
[](
const
bar
&
val
)
{
cout
<<
"bar(foo("
<<
val
.
f
.
a
()
<<
","
<<
val
.
f
.
b
()
<<
"),"
<<
val
.
i
<<
")"
<<
endl
;
}
);
return
0
;
}
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