Skip to content

Commit

Permalink
Merge pull request #318 from jwillemsen/jwi-namespaces
Browse files Browse the repository at this point in the history
More usage of TAOX11_NAMESPACE::PS
  • Loading branch information
jwillemsen authored Aug 18, 2023
2 parents d1523bd + 70f35d1 commit 04f2ef1
Show file tree
Hide file tree
Showing 27 changed files with 259 additions and 301 deletions.
41 changes: 19 additions & 22 deletions ridlbe/c++11/templates/cli/hdr/ami/interface_amic_traits.erb
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@

// generated from <%= ridl_template_path %>
namespace IDL
template <typename OStrm_>
struct formatter<<%= amic_scoped_cxxtype %>, OStrm_>
{
template <typename OStrm_>
struct formatter<<%= amic_scoped_cxxtype %>, OStrm_>
inline OStrm_& operator ()(OStrm_& os_, <%= amic_scoped_cxx_in_type %> val_)
{
inline OStrm_& operator ()(OStrm_& os_, <%= amic_scoped_cxx_in_type %> val_)
{
os_ << IDL::traits<TAOX11_CORBA::Object>::_dump (std::move (val_), "<%= formatted_cxxname %>", true);
return os_;
}
};

template <typename OStrm_, typename Fmt>
inline OStrm_& operator <<(OStrm_& os, TAOX11_CORBA::amic_traits <<%= scoped_cxxtype %>>::__Writer<Fmt> w)
{
using writer_t = TAOX11_CORBA::amic_traits <<%= scoped_cxxtype %>>::__Writer<Fmt>;
using formatter_t = typename std::conditional<
std::is_same<
typename writer_t::formatter_t,
std::false_type>::value,
IDL::formatter<<%= amic_scoped_cxxtype %>, OStrm_>,
typename writer_t::formatter_t>::type;
return TAOX11_CORBA::amic_traits <<%= scoped_cxxtype %>>::write_on (os, w.val_, formatter_t ());
os_ << IDL::traits<TAOX11_CORBA::Object>::_dump (std::move (val_), "<%= formatted_cxxname %>", true);
return os_;
}
} // namespace IDL
};

template <typename OStrm_, typename Fmt>
inline OStrm_& operator <<(OStrm_& os, TAOX11_CORBA::amic_traits <<%= scoped_cxxtype %>>::__Writer<Fmt> w)
{
using writer_t = TAOX11_CORBA::amic_traits <<%= scoped_cxxtype %>>::__Writer<Fmt>;
using formatter_t = typename std::conditional<
std::is_same<
typename writer_t::formatter_t,
std::false_type>::value,
IDL::formatter<<%= amic_scoped_cxxtype %>, OStrm_>,
typename writer_t::formatter_t>::type;
return TAOX11_CORBA::amic_traits <<%= scoped_cxxtype %>>::write_on (os, w.val_, formatter_t ());
}
4 changes: 2 additions & 2 deletions ridlbe/c++11/templates/cli/prx/interface_pre.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class <%= stub_export_macro %><%= proxy_cxxname %>
% if is_derived?
% if !has_concrete_base?
: public virtual <%= proxy_root_base %>
: public virtual <%= proxy_root_base %>
% _first = false
% else
% _first = true
Expand All @@ -13,7 +13,7 @@ class <%= stub_export_macro %><%= proxy_cxxname %>
% _first = false
% end
% else
: public virtual <%= proxy_root_base %>
: public virtual <%= proxy_root_base %>
% end
{
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#define <%= _traits_incl_guard_ %>
// Arg traits specializations.
template<>
class PS::SArg_Traits<TAOX11_NAMESPACE::Messaging::ExceptionHolder>
class SArg_Traits<TAOX11_NAMESPACE::Messaging::ExceptionHolder>
: public Basic_SArg_Traits_T<TAOX11_IDL::traits<TAOX11_NAMESPACE::Messaging::ExceptionHolder>::ref_type, Any_Insert_Policy_Stream>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/array_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define _ALIAS_<%= alias_md5 %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/bitmask_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/bitset_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/enum_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>,<% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/interface_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#if !defined (_<%= _traits_incl_guard_ %>_SARG_TRAITS_)
#define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxx_traits_type %>::ref_type, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/map_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define _ALIAS_<%= alias_md5 %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/sequence_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define _ALIAS_<%= alias_md5 %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %><% if generate_anyinsert_adapter? %>Any_Insert_Policy_AnyInsert_Adapter<% else %>Any_Insert_Policy_Stream<% end %><% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/string_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#define _ALIAS_<%= alias_md5 %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %><% if generate_anyinsert_adapter? %>Any_Insert_Policy_AnyInsert_Adapter<% else %>Any_Insert_Policy_Stream<% end %><% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/struct_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/union_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxxtype %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
2 changes: 1 addition & 1 deletion ridlbe/c++11/templates/srv/src/value_sarg_traits.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# define _<%= _traits_incl_guard_ %>_SARG_TRAITS_
/// Argument traits specializations for <%= name %>
template<>
class PS::SArg_Traits<<%= scoped_cxxtype %>>
class SArg_Traits<<%= scoped_cxxtype %>>
: public Basic_SArg_Traits_T<<%= scoped_cxx_in_type %>, <% if generate_any_support? %>Any_Insert_Policy_Stream<% else %>Any_Insert_Policy_Noop<% end %>>
{
};
Expand Down
4 changes: 2 additions & 2 deletions ridlbe/c++11/writers/amistubheader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -511,14 +511,14 @@ def initialize(output = STDOUT, opts = {})
def pre_visit(_parser)
println
printiln('// generated from AmiStubHeaderAmicTraitsWriter#pre_visit')
printiln('namespace TAOX11_NAMESPACE')
printiln('namespace TAOX11_NAMESPACE::IDL')
printiln('{')
inc_nest
end

def post_visit(_parser)
dec_nest
printiln('} // namespace TAOX11_NAMESPACE')
printiln('} // namespace TAOX11_NAMESPACE::IDL')
end

def enter_interface(node)
Expand Down
4 changes: 2 additions & 2 deletions ridlbe/c++11/writers/amistubsource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -846,13 +846,13 @@ def pre_visit(parser)
super
println
printiln('// generated from AmiStubSourceSArgTraitsWriter#pre_visit')
println('namespace TAOX11_NAMESPACE {')
println('namespace TAOX11_NAMESPACE::PS {')
gen_exceptionholder_traits
end

def post_visit(parser)
println
println('} // namespace TAOX11_NAMESPACE')
println('} // namespace TAOX11_NAMESPACE::PS')
super
end

Expand Down
4 changes: 2 additions & 2 deletions ridlbe/c++11/writers/servantsource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ def pre_visit(parser)
super
println
printiln('// generated from ServantSourceSArgTraitsWriter#pre_visit')
printiln('namespace TAOX11_NAMESPACE')
printiln('namespace TAOX11_NAMESPACE::PS')
printiln('{')
end

def post_visit(parser)
println
println('} // namespace TAOX11_NAMESPACE')
println('} // namespace TAOX11_NAMESPACE:PS')
super
end

Expand Down
22 changes: 9 additions & 13 deletions tao/x11/anytypecode/any_sarg_traits.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,16 @@

#include "tao/x11/object.h"

namespace TAOX11_NAMESPACE
namespace TAOX11_NAMESPACE::PS
{

namespace PS
/// Used in generated code if CORBA::Any is an argument or
/// return type.
template<>
class SArg_Traits<TAOX11_NAMESPACE::CORBA::Any>
: public Basic_SArg_Traits_T<TAOX11_NAMESPACE::CORBA::Any,
Any_Insert_Policy_Stream>
{
/// Used in generated code if CORBA::Any is an argument or
/// return type.
template<>
class SArg_Traits<TAOX11_NAMESPACE::CORBA::Any>
: public Basic_SArg_Traits_T<TAOX11_NAMESPACE::CORBA::Any,
Any_Insert_Policy_Stream>
{
};
} // namespace PS
} // namespace TAOX11_NAMESPACE
};
} // namespace TAOX11_NAMESPACE::PS

#endif /* TAOX11_ANYTYPECODE_ANY_SARG_TRAITS_T_H */
9 changes: 2 additions & 7 deletions tao/x11/portable_server/basic_sargument_t.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,8 @@
#include "tao/x11/portable_server/basic_sargument_t.h"
#endif /* ACE_TEMPLATES_REQUIRE_PRAGMA */

namespace TAOX11_NAMESPACE
namespace TAOX11_NAMESPACE::PS
{

namespace PS {

template<typename S,
template <typename> class Insert_Policy>
TAO_CORBA::Boolean
Expand Down Expand Up @@ -112,8 +109,6 @@ Ret_Basic_SArgument_T<S,Insert_Policy>::interceptor_value (TAO_CORBA::Any *any)

#endif /* TAO_HAS_INTERCEPTORS */

} // namespace PS

} // namespace TAOX11_NAMESPACE
} // namespace TAOX11_NAMESPACE::PS

#endif /* TAOX11_BASIC_SARGUMENT_T_CPP */
Loading

0 comments on commit 04f2ef1

Please sign in to comment.