-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #140 from SylvainCorlay/xwidgets-fixups
xwidgets fixups
- Loading branch information
Showing
5 changed files
with
50 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*************************************************************************** | ||
* Copyright (c) 2017, Sylvain Corlay and Johan Mabille * | ||
* * | ||
* Distributed under the terms of the BSD 3-Clause License. * | ||
* * | ||
* The full license is in the file LICENSE, distributed with this software. * | ||
****************************************************************************/ | ||
|
||
#ifndef XWIDGETS_MAKER_HPP | ||
#define XWIDGETS_MAKER_HPP | ||
|
||
#include "xeus/xcomm.hpp" | ||
#include "xeus/xjson.hpp" | ||
#include "xeus/xmessage.hpp" | ||
|
||
#include "xholder.hpp" | ||
#include "xmaterialize.hpp" | ||
|
||
namespace xw | ||
{ | ||
/******************* | ||
* xmaker template * | ||
*******************/ | ||
|
||
template <template <class> class CRTP, class... P> | ||
void xmaker(xeus::xcomm&& comm, const xeus::xjson& state, const xeus::buffer_sequence& buffers) | ||
{ | ||
auto model = xgenerator<CRTP, P...>(std::move(comm), true); | ||
model.apply_patch(state, buffers); | ||
get_transport_registry().register_owning(reinterpret_cast<xmaterialize<CRTP, P...>&&>(model)); | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters