Skip to content

Commit 722a457

Browse files
committed
#2387: callback: add forward declaration to fix circular dependency
1 parent bef9f41 commit 722a457

File tree

4 files changed

+66
-13
lines changed

4 files changed

+66
-13
lines changed

src/vt/objgroup/proxy/proxy_objgroup.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#include "vt/objgroup/proxy/proxy_objgroup_elm.h"
5151
#include "vt/objgroup/active_func/active_func.h"
5252
#include "vt/messaging/message/smart_ptr.h"
53-
#include "vt/pipe/pipe_callback_only.h"
53+
#include "vt/pipe/callback/cb_union/cb_raw_base.fwd.h"
5454
#include "vt/collective/reduce/operators/functors/none_op.h"
5555
#include "vt/collective/reduce/operators/callback_op.h"
5656
#include "vt/collective/reduce/reduce_scope.h"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
/*
2+
//@HEADER
3+
// *****************************************************************************
4+
//
5+
// cb_raw_base_fwd.h
6+
// DARMA/vt => Virtual Transport
7+
//
8+
// Copyright 2019-2024 National Technology & Engineering Solutions of Sandia, LLC
9+
// (NTESS). Under the terms of Contract DE-NA0003525 with NTESS, the U.S.
10+
// Government retains certain rights in this software.
11+
//
12+
// Redistribution and use in source and binary forms, with or without
13+
// modification, are permitted provided that the following conditions are met:
14+
//
15+
// * Redistributions of source code must retain the above copyright notice,
16+
// this list of conditions and the following disclaimer.
17+
//
18+
// * Redistributions in binary form must reproduce the above copyright notice,
19+
// this list of conditions and the following disclaimer in the documentation
20+
// and/or other materials provided with the distribution.
21+
//
22+
// * Neither the name of the copyright holder nor the names of its
23+
// contributors may be used to endorse or promote products derived from this
24+
// software without specific prior written permission.
25+
//
26+
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
27+
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28+
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29+
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
30+
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31+
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32+
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33+
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34+
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35+
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36+
// POSSIBILITY OF SUCH DAMAGE.
37+
//
38+
// Questions? Contact darma@sandia.gov
39+
//
40+
// *****************************************************************************
41+
//@HEADER
42+
*/
43+
44+
#if !defined INCLUDED_VT_PIPE_CALLBACK_CB_UNION_CB_RAW_BASE_FWD_H
45+
#define INCLUDED_VT_PIPE_CALLBACK_CB_UNION_CB_RAW_BASE_FWD_H
46+
47+
namespace vt { namespace pipe { namespace callback { namespace cbunion {
48+
49+
template <typename... Args> struct CallbackTyped;
50+
51+
struct CallbackRawBaseSingle;
52+
53+
}}} // end namespace pipe::callback::cbunion
54+
55+
template <typename... Args>
56+
using Callback = pipe::callback::cbunion::CallbackTyped<Args...>;
57+
58+
using CallbackU = pipe::callback::cbunion::CallbackRawBaseSingle;
59+
60+
} // end namespace vt
61+
62+
#endif /*INCLUDED_VT_PIPE_CALLBACK_CB_UNION_CB_RAW_BASE_FWD_H*/

src/vt/pipe/callback/cb_union/cb_raw_base.h

+2-12
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
#define INCLUDED_VT_PIPE_CALLBACK_CB_UNION_CB_RAW_BASE_H
4646

4747
#include "vt/config.h"
48+
#include "vt/pipe/pipe_callback_only.h"
49+
#include "vt/pipe/callback/cb_union/cb_raw_base.fwd.h"
4850
#include "vt/pipe/callback/cb_union/cb_raw.h"
4951
#include "vt/pipe/signal/signal.h"
5052
#include "vt/registry/auto/auto_registry_common.h"
@@ -69,9 +71,6 @@ static struct RawSendObjGrpTagType { } RawSendObjGrpTag { };
6971
static struct RawBcastObjGrpTagType { } RawBcastObjGrpTag { };
7072
#pragma GCC diagnostic pop
7173

72-
template <typename... Args>
73-
struct CallbackTyped;
74-
7574
struct CallbackRawBaseSingle {
7675
using AutoHandlerType = auto_registry::AutoHandlerType;
7776

@@ -308,15 +307,6 @@ struct CallbackTyped : CallbackRawBaseSingle {
308307

309308
}}}} /* end namespace vt::pipe::callback::cbunion */
310309

311-
namespace vt {
312-
313-
template <typename... Args>
314-
using Callback = pipe::callback::cbunion::CallbackTyped<Args...>;
315-
316-
using CallbackU = pipe::callback::cbunion::CallbackRawBaseSingle;
317-
318-
} /* end namespace vt */
319-
320310
#include "vt/pipe/callback/cb_union/cb_raw_base.impl.h"
321311

322312
#endif /*INCLUDED_VT_PIPE_CALLBACK_CB_UNION_CB_RAW_BASE_H*/

src/vt/trace/trace.h

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
#include "vt/trace/trace_log.h"
5050
#include "vt/trace/trace_registry.h"
5151
#include "vt/trace/trace_lite.h"
52+
#include "vt/objgroup/proxy/proxy_objgroup.h"
5253
#include "vt/runtime/component/component_pack.h"
5354

5455
#include "vt/timing/timing.h"

0 commit comments

Comments
 (0)