The Fortran 90 backdoor initializer is very similar to C. Fortran 90 also has a _wrapObj, but it is actually defined in the wrapper_Data_Mod.F90 file, along with the private data type definition.
Here is the private data definition from wrapper_Data_Mod.F90:
type wrapper_Data_priv sequence ! DO-NOT-DELETE splicer.begin(wrapper.Data.private_data) ! Insert-Code-Here {wrapper.Data.private_data} (private data members) character(len=256) :: d_ctortest character(len=256) :: d_string integer(kind=sidl_int) :: d_int ! DO-NOT-DELETE splicer.end(wrapper.Data.private_data) end type wrapper_Data_priv
Here is the client code from wraptest.F90. Notice wrapper_Data_impl
is used. From wraptest.F90:
#include "wrapper_User_fAbbrev.h" #include "wrapper_Data_fAbbrev.h" #include "synch_RegOut_fAbbrev.h" #include "synch_ResultType_fAbbrev.h" program wraptest use sidl use sidl_BaseInterface use wrapper_User use wrapper_Data use wrapper_Data_impl type(sidl_BaseInterface_t) :: throwaway_exception type(wrapper_Data_wrap) :: pd type(wrapper_Data_t) :: data type(wrapper_User_t) :: user allocate(pd%d_private_data) pd%d_private_data%d_int = 0 pd%d_private_data%d_string = 'place holder' pd%d_private_data%d_ctortest = 'place holder' call new(user, throwaway_exception) call wrapObj(pd, data, throwaway_exception) print *, pd%d_private_data%d_ctortest call accept(user, data, throwaway_exception) print *, pd%d_private_data%d_string, ' ', pd%d_private_data%d_int call deleteRef(user, throwaway_exception) call deleteRef(data, throwaway_exception) ! Private data [should be] deallocated by the Impl dtor. call close(tracker, throwaway_exception) call deleteRef(tracker, throwaway_exception) end program wraptest
Finally, the Impl code from wrapper_Data_Impl.F90:
recursive subroutine wrapper_Data__ctor2_mi(self, private_data, exception) use sidl use sidl_BaseInterface use sidl_RuntimeException use wrapper_Data use wrapper_Data_impl implicit none type(wrapper_Data_t) :: self ! in type(wrapper_Data_wrap) :: private_data type(sidl_BaseInterface_t) :: exception ! out ! DO-NOT-DELETE splicer.begin(wrapper.Data._ctor2) private_data%d_private_data%d_ctortest = 'ctor was run' ! DO-NOT-DELETE splicer.end(wrapper.Data._ctor2) end subroutine wrapper_Data__ctor2_mi recursive subroutine wrapper_Data_setString_mi(self, s, exception) use sidl use sidl_BaseInterface use sidl_RuntimeException use wrapper_Data use wrapper_Data_impl implicit none type(wrapper_Data_t) :: self ! in character (len=*) :: s ! in type(sidl_BaseInterface_t) :: exception ! out ! DO-NOT-DELETE splicer.begin(wrapper.Data.setString) type(wrapper_Data_wrap) :: dp call wrapper_Data__get_data_m(self, dp) dp%d_private_data%d_string = s ! DO-NOT-DELETE splicer.end(wrapper.Data.setString) end subroutine wrapper_Data_setString_mi recursive subroutine wrapper_Data_setInt_mi(self, i, exception) use sidl use sidl_BaseInterface use sidl_RuntimeException use wrapper_Data use wrapper_Data_impl implicit none type(wrapper_Data_t) :: self ! in integer (kind=sidl_int) :: i ! in type(sidl_BaseInterface_t) :: exception ! out ! DO-NOT-DELETE splicer.begin(wrapper.Data.setInt) type(wrapper_Data_wrap) :: dp call wrapper_Data__get_data_m(self, dp) dp%d_private_data%d_int = i ! DO-NOT-DELETE splicer.end(wrapper.Data.setInt) end subroutine wrapper_Data_setInt_mi