[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: SIP v4.19.23 adds dependency on assignment operator
From:       Matthijs van der Burgh <MatthijsBurgh () outlook ! com>
Date:       2020-06-27 8:47:57
Message-ID: AM0PR09MB3443FF554400127ED4F672FDA2900 () AM0PR09MB3443 ! eurprd09 ! prod ! outlook ! com
[Download RAW message or body]

For clarity for future readers.

It is needed to define it in the SIP file. Only defining a private assignment \
operator in cpp, causes the `is private within this context` error.

As you might want different API's for your python module than your cpp library, it is \
not needed to define it (as private or at all) in cpp. As long as you define it as \
private in the SIP file.

Matthijs

________________________________
Van: Jochen Sprickerhof
Verzonden: Vrijdag, 26 Juni, 2020 16:32
Aan: Phil Thompson
CC: pyqt@riverbankcomputing.com
Onderwerp: Re: SIP v4.19.23 adds dependency on assignment operator

* Phil Thompson <phil@riverbankcomputing.com> [2020-06-26 15:28]:
> > * Phil Thompson <phil@riverbankcomputing.com> [2020-06-26 14:46]:
> > > So you need to tell SIP this by defining a private assignment
> > > operator.
> > 
> > I tried that but SIP still generates code that is refused by gcc:
> > 
> > orocos_kdl/src/chainiksolvervel_pinv_givens.hpp:
> > 
> > +     private:
> > +         ChainIkSolverVel_pinv_givens& operator=(const
> > ChainIkSolverVel_pinv_givens& other);
> > 
> > python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp:
> > 
> > extern "C" {static void
> > dealloc_ChainIkSolverVel_pinv_givens(sipSimpleWrapper *);}
> > static void dealloc_ChainIkSolverVel_pinv_givens(sipSimpleWrapper
> > *sipSelf)
> > {
> > if (sipIsDerivedClass(sipSelf))
> > reinterpret_cast<sipChainIkSolverVel_pinv_givens
> > *>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;
> > 
> > if (sipIsOwnedByPython(sipSelf))
> > {
> > release_ChainIkSolverVel_pinv_givens(sipGetAddress(sipSelf),
> > sipIsDerivedClass(sipSelf));
> > }
> > }
> > 
> > python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp: In function ‘void
> > assign_ChainIkSolverVel_pinv_givens(void*, Py_ssize_t, void*)’:
> > python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp:1047:137: error:
> > ‘KDL::ChainIkSolverVel_pinv_givens&
> > KDL::ChainIkSolverVel_pinv_givens::operator=(const
> > KDL::ChainIkSolverVel_pinv_givens&)’ is private within this context
> > 1047 |     if (sipIsDerivedClass(sipSelf))
> > 
> > Do you have an idea why?
> 
> You'll have to send me the relevant .sip files.

Not sure what you need but there is a PR trying to implement this here:

https://github.com/orocos/orocos_kinematics_dynamics/pull/269

> > Also, the assignment operator is already removed by the compiler,
> > having to manually define it private sounds superfluous.
> 
> SIP isn't a full C++ parser - it doesn't know that the compiler will
> delete the operator.

Yeah, I guessed so already.


[Attachment #3 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; \
color: rgb(0, 0, 0);"> </div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; color: black; background-color: rgb(255, 255, 255)"> For clarity for \
future readers.<br> </div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; color: black; background-color: rgb(255, 255, 255)"> <br>
It is needed to define it in the SIP file. Only defining a private assignment \
operator in cpp, causes the `<span style="margin: 0px; font-size: 13.44px; \
font-family: Verdana, Geneva, Helvetica, Arial, sans-serif; background-color: \
white">is private within this  context</span>` error.<br>
<br>
</div>
<div style="margin: 0px; font-size: 15px; font-family: &quot;Segoe UI&quot;, \
&quot;Segoe UI Web (West European)&quot;, &quot;Segoe UI&quot;, -apple-system, \
BlinkMacSystemFont, Roboto, &quot;Helvetica Neue&quot;, sans-serif; color: rgb(32, \
31, 30); background-color: rgb(255, 255, 255)"> <div style="margin: 0px">
<div style="margin: 0px">
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; color: black; background-color: white"> As you might want different API's \
for your python module than your cpp library, it is not needed to define it (as \
private or at all) in cpp. As long as you define it as private in the SIP file.</div> \
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Arial, Helvetica, \
sans-serif; color: black; background-color: white"> <br>
Matthijs</div>
</div>
</div>
</div>
<div>
<div id="Signature">
<div>
<div id="divtagdefaultwrapper" style="font-size:12pt; color:#000000; \
background-color:#ffffff; font-family:Calibri,Arial,Helvetica,sans-serif"> </div>
<div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0);"> <br>
<hr tabindex="-1" style="display:inline-block; width:98%;">
<b>Van:</b> Jochen Sprickerhof<br>
<b>Verzonden:</b> Vrijdag, 26 Juni, 2020 16:32<br>
<b>Aan:</b> Phil Thompson<br>
<b>CC:</b> pyqt@riverbankcomputing.com<br>
<b>Onderwerp:</b> Re: SIP v4.19.23 adds dependency on assignment operator
<div><br>
</div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">* Phil Thompson &lt;phil@riverbankcomputing.com&gt; \
[2020-06-26 15:28]:<br> &gt;&gt;* Phil Thompson &lt;phil@riverbankcomputing.com&gt; \
[2020-06-26 14:46]:<br> &gt;&gt;&gt;So you need to tell SIP this by defining a \
private assignment <br> &gt;&gt;&gt;operator.<br>
&gt;&gt;<br>
&gt;&gt;I tried that but SIP still generates code that is refused by gcc:<br>
&gt;&gt;<br>
&gt;&gt;orocos_kdl/src/chainiksolvervel_pinv_givens.hpp:<br>
&gt;&gt;<br>
&gt;&gt;&#43;&nbsp;&nbsp;&nbsp;&nbsp; private:<br>
&gt;&gt;&#43;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
ChainIkSolverVel_pinv_givens&amp; operator=(const<br> \
&gt;&gt;ChainIkSolverVel_pinv_givens&amp; other);<br> &gt;&gt;<br>
&gt;&gt;python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp:<br>
&gt;&gt;<br>
&gt;&gt;extern &quot;C&quot; {static void<br>
&gt;&gt;dealloc_ChainIkSolverVel_pinv_givens(sipSimpleWrapper *);}<br>
&gt;&gt;static void dealloc_ChainIkSolverVel_pinv_givens(sipSimpleWrapper <br>
&gt;&gt;*sipSelf)<br>
&gt;&gt;{<br>
&gt;&gt;&nbsp;&nbsp;&nbsp; if (sipIsDerivedClass(sipSelf))<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
reinterpret_cast&lt;sipChainIkSolverVel_pinv_givens<br> \
&gt;&gt;*&gt;(sipGetAddress(sipSelf))-&gt;sipPySelf = SIP_NULLPTR;<br> &gt;&gt;<br>
&gt;&gt;&nbsp;&nbsp;&nbsp; if (sipIsOwnedByPython(sipSelf))<br>
&gt;&gt;&nbsp;&nbsp;&nbsp; {<br>
&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
release_ChainIkSolverVel_pinv_givens(sipGetAddress(sipSelf),<br> \
&gt;&gt;sipIsDerivedClass(sipSelf));<br> &gt;&gt;&nbsp;&nbsp;&nbsp; }<br>
&gt;&gt;}<br>
&gt;&gt;<br>
&gt;&gt;python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp: In function ‘void<br>
&gt;&gt;assign_ChainIkSolverVel_pinv_givens(void*, Py_ssize_t, void*)’:<br>
&gt;&gt;python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp:1047:137: error:<br>
&gt;&gt;‘KDL::ChainIkSolverVel_pinv_givens&amp;<br>
&gt;&gt;KDL::ChainIkSolverVel_pinv_givens::operator=(const<br>
&gt;&gt;KDL::ChainIkSolverVel_pinv_givens&amp;)’ is private within this context<br>
&gt;&gt; 1047 |&nbsp;&nbsp;&nbsp;&nbsp; if (sipIsDerivedClass(sipSelf))<br>
&gt;&gt;<br>
&gt;&gt;Do you have an idea why?<br>
&gt;<br>
&gt;You'll have to send me the relevant .sip files.<br>
<br>
Not sure what you need but there is a PR trying to implement this here:<br>
<br>
<a href="https://github.com/orocos/orocos_kinematics_dynamics/pull/269" \
target="_blank" rel="noopener noreferrer" \
data-auth="NotApplicable">https://github.com/orocos/orocos_kinematics_dynamics/pull/269</a><br>
 <br>
&gt;&gt;Also, the assignment operator is already removed by the compiler,<br>
&gt;&gt;having to manually define it private sounds superfluous.<br>
&gt;<br>
&gt;SIP isn't a full C&#43;&#43; parser - it doesn't know that the compiler will <br>
&gt;delete the operator.<br>
<br>
Yeah, I guessed so already.<br>
</div>
</span></font></div>
</div>
</div>
</div>
</div>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic