Skip to content

Commit

Permalink
restore previous formatting of writeClassParamDefinition
Browse files Browse the repository at this point in the history
  • Loading branch information
3dJan committed Dec 5, 2024
1 parent ecf040a commit 71a2ea0
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions Source/buildbindingccpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1200,34 +1200,34 @@ func getCPPInheritanceSpecifier(component ComponentDefinition, class ComponentDe
}

func writeClassParamDefinition(w LanguageWriter, NameSpace string) {
w.Writeln("")
w.Writeln("/*************************************************************************************************************************")
w.Writeln(" classParam Definition")
w.Writeln("**************************************************************************************************************************/")
w.Writeln("")
w.Writeln("template<class T> class classParam {")
w.Writeln("private:")
w.Writeln(" std::shared_ptr<T> m_sharedPtr;")
w.Writeln(" const T* m_ptr;")
w.Writeln("")
w.Writeln("public:")
w.Writeln(" classParam(const T* ptr)")
w.Writeln(" : m_ptr(ptr)")
w.Writeln(" {")
w.Writeln(" }")
w.Writeln("")
w.Writeln(" classParam(std::shared_ptr<T> sharedPtr)")
w.Writeln(" : m_sharedPtr(sharedPtr), m_ptr(sharedPtr.get())")
w.Writeln(" {")
w.Writeln(" }")
w.Writeln("")
w.Writeln(" %sHandle GetHandle()", NameSpace)
w.Writeln(" {")
w.Writeln(" if (m_ptr != nullptr)")
w.Writeln(" return m_ptr->handle();")
w.Writeln(" return (%sHandle)nullptr;", NameSpace)
w.Writeln(" }")
w.Writeln("};")
w.Writeln("")
w.Writeln("/*************************************************************************************************************************")
w.Writeln(" classParam Definition")
w.Writeln("**************************************************************************************************************************/")
w.Writeln("")
w.Writeln("template<class T> class classParam {")
w.Writeln("private:")
w.Writeln(" std::shared_ptr<T> m_sharedPtr;")
w.Writeln(" const T* m_ptr;")
w.Writeln("")
w.Writeln("public:")
w.Writeln(" classParam(const T* ptr)")
w.Writeln(" : m_ptr(ptr)")
w.Writeln(" {")
w.Writeln(" }")
w.Writeln("")
w.Writeln(" classParam(std::shared_ptr<T> sharedPtr)")
w.Writeln(" : m_sharedPtr(sharedPtr), m_ptr(sharedPtr.get())")
w.Writeln(" {")
w.Writeln(" }")
w.Writeln("")
w.Writeln(" %sHandle GetHandle()", NameSpace)
w.Writeln(" {")
w.Writeln(" if (m_ptr != nullptr)")
w.Writeln(" return m_ptr->handle();")
w.Writeln(" return (%sHandle)nullptr;", NameSpace)
w.Writeln(" }")
w.Writeln("};")
}

func writeExceptionClass(w LanguageWriter, NameSpace string, errors ComponentDefinitionErrors) {
Expand Down

0 comments on commit 71a2ea0

Please sign in to comment.