VTK-m  2.0
TransportTagArrayOut.h
Go to the documentation of this file.
1 //============================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //============================================================================
10 #ifndef vtk_m_cont_arg_TransportTagArrayOut_h
11 #define vtk_m_cont_arg_TransportTagArrayOut_h
12 
13 #include <vtkm/Deprecated.h>
14 #include <vtkm/Types.h>
15 
16 #include <vtkm/cont/ArrayHandle.h>
17 
19 
20 namespace vtkm
21 {
22 namespace cont
23 {
24 namespace arg
25 {
26 
33 {
34 };
35 
36 template <typename ContObjectType, typename Device>
37 struct Transport<vtkm::cont::arg::TransportTagArrayOut, ContObjectType, Device>
38 {
39  // MSVC will issue deprecation warnings here if this template is instantiated with
40  // a deprecated class even if the template is used from a section of code where
41  // deprecation warnings are suppressed. This is annoying behavior since this template
42  // has no control over what class it is used with. To get around it, we have to
43  // suppress all deprecation warnings here.
44 #ifdef VTKM_MSVC
46 #endif
47 
48  // If you get a compile error here, it means you tried to use an object that
49  // is not an array handle as an argument that is expected to be one.
50  VTKM_IS_ARRAY_HANDLE(ContObjectType);
51 
52  using ExecObjectType =
53  decltype(std::declval<ContObjectType>().PrepareForOutput(vtkm::Id{},
54  Device{},
55  std::declval<vtkm::cont::Token&>()));
56 
57  template <typename InputDomainType>
58  VTKM_CONT ExecObjectType operator()(ContObjectType& object,
59  const InputDomainType& vtkmNotUsed(inputDomain),
60  vtkm::Id vtkmNotUsed(inputRange),
61  vtkm::Id outputRange,
62  vtkm::cont::Token& token) const
63  {
64  return object.PrepareForOutput(outputRange, Device(), token);
65  }
66 
67 #ifdef VTKM_MSVC
69 #endif
70 };
71 }
72 }
73 } // namespace vtkm::cont::arg
74 
75 #endif //vtk_m_cont_arg_TransportTagArrayOut_h
ArrayHandle.h
vtkm
Groups connected points that have the same field value.
Definition: Atomic.h:19
Types.h
vtkm::cont::arg::TransportTagArrayOut
Transport tag for output arrays.
Definition: TransportTagArrayOut.h:32
vtkm::Id
vtkm::Int32 Id
Represents an ID (index into arrays).
Definition: Types.h:191
VTKM_DEPRECATED_SUPPRESS_END
#define VTKM_DEPRECATED_SUPPRESS_END
Definition: Deprecated.h:123
vtkm::cont::Token
A token to hold the scope of an ArrayHandle or other object.
Definition: Token.h:35
VTKM_IS_ARRAY_HANDLE
#define VTKM_IS_ARRAY_HANDLE(T)
Definition: ArrayHandle.h:132
VTKM_CONT
#define VTKM_CONT
Definition: ExportMacros.h:57
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagArrayOut, ContObjectType, Device >::ExecObjectType
decltype(std::declval< ContObjectType >().PrepareForOutput(vtkm::Id{}, Device{}, std::declval< vtkm::cont::Token & >())) ExecObjectType
Definition: TransportTagArrayOut.h:55
vtkmNotUsed
#define vtkmNotUsed(parameter_name)
Simple macro to identify a parameter as unused.
Definition: ExportMacros.h:128
Transport.h
VTKM_DEPRECATED_SUPPRESS_BEGIN
#define VTKM_DEPRECATED_SUPPRESS_BEGIN
Definition: Deprecated.h:122
Deprecated.h
vtkm::cont::arg::Transport
Class for transporting from the control to the execution environment.
Definition: Transport.h:38
vtkm::cont::arg::Transport< vtkm::cont::arg::TransportTagArrayOut, ContObjectType, Device >::operator()
VTKM_CONT ExecObjectType operator()(ContObjectType &object, const InputDomainType &vtkmNotUsed(inputDomain), vtkm::Id vtkmNotUsed(inputRange), vtkm::Id outputRange, vtkm::cont::Token &token) const
Definition: TransportTagArrayOut.h:58