7 #ifndef IGLOO_CONTEXTPROVIDER_H_ 8 #define IGLOO_CONTEXTPROVIDER_H_ 17 inline bool IsContextMarkedAsOnly()
19 return T::IsContextMarkedAsOnly();
26 inline bool IsContextMarkedAsOnly<ContextWithAttribute<void> >()
35 inline bool IsContextMarkedAsSkip()
37 return T::IsMarkedAsSkip();
44 inline bool IsContextMarkedAsSkip<ContextWithAttribute<void> >()
64 template <
typename InnerContext,
typename OuterContext,
bool ISONLY,
bool ISSKIP>
72 typedef InnerContext IGLOO_CURRENT_CONTEXT;
74 static bool IsContextMarkedAsOnly()
78 detail::IsContextMarkedAsOnly<OuterContext>();
81 static bool IsMarkedAsSkip()
83 return ISSKIP || detail::IsContextMarkedAsSkip<OuterContext>();
86 virtual OuterContext& Parent()
88 if(m_outerContext.get() == 0)
90 m_outerContext = std::auto_ptr<OuterContext>(CreateIglooContext<OuterContext>());
92 return *(m_outerContext.get());
95 virtual void IglooFrameworkSetUp()
97 Parent().IglooFrameworkSetUp();
101 virtual void IglooFrameworkTearDown()
104 Parent().IglooFrameworkTearDown();
108 template <
typename ContextType>
109 ContextType* CreateIglooContext()
111 return new ContextType();
114 std::auto_ptr<OuterContext> m_outerContext;
120 template <
typename InnerContext,
typename OuterContext,
typename RootContext,
bool ISONLY,
bool ISSKIP>
136 template <
typename InnerContext,
bool ISONLY,
bool ISSKIP>
144 typedef InnerContext IGLOO_ROOT_CONTEXT;
152 return *(
static_cast<InnerContext*
>(
this));
Definition: contextprovider.h:121
Definition: contextregistry.h:26
Definition: contextprovider.h:65