[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: "Segoe UI", \
"Segoe UI Web (West European)", "Segoe UI", -apple-system, \
BlinkMacSystemFont, Roboto, "Helvetica Neue", 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 <phil@riverbankcomputing.com> \
[2020-06-26 15:28]:<br> >>* Phil Thompson <phil@riverbankcomputing.com> \
[2020-06-26 14:46]:<br> >>>So you need to tell SIP this by defining a \
private assignment <br> >>>operator.<br>
>><br>
>>I tried that but SIP still generates code that is refused by gcc:<br>
>><br>
>>orocos_kdl/src/chainiksolvervel_pinv_givens.hpp:<br>
>><br>
>>+ private:<br>
>>+ \
ChainIkSolverVel_pinv_givens& operator=(const<br> \
>>ChainIkSolverVel_pinv_givens& other);<br> >><br>
>>python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp:<br>
>><br>
>>extern "C" {static void<br>
>>dealloc_ChainIkSolverVel_pinv_givens(sipSimpleWrapper *);}<br>
>>static void dealloc_ChainIkSolverVel_pinv_givens(sipSimpleWrapper <br>
>>*sipSelf)<br>
>>{<br>
>> if (sipIsDerivedClass(sipSelf))<br>
>> \
reinterpret_cast<sipChainIkSolverVel_pinv_givens<br> \
>>*>(sipGetAddress(sipSelf))->sipPySelf = SIP_NULLPTR;<br> >><br>
>> if (sipIsOwnedByPython(sipSelf))<br>
>> {<br>
>> \
release_ChainIkSolverVel_pinv_givens(sipGetAddress(sipSelf),<br> \
>>sipIsDerivedClass(sipSelf));<br> >> }<br>
>>}<br>
>><br>
>>python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp: In function ‘void<br>
>>assign_ChainIkSolverVel_pinv_givens(void*, Py_ssize_t, void*)’:<br>
>>python_orocos_kdl/PyKDL/sip/sipPyKDLpart1.cpp:1047:137: error:<br>
>>‘KDL::ChainIkSolverVel_pinv_givens&<br>
>>KDL::ChainIkSolverVel_pinv_givens::operator=(const<br>
>>KDL::ChainIkSolverVel_pinv_givens&)’ is private within this context<br>
>> 1047 | if (sipIsDerivedClass(sipSelf))<br>
>><br>
>>Do you have an idea why?<br>
><br>
>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>
>>Also, the assignment operator is already removed by the compiler,<br>
>>having to manually define it private sounds superfluous.<br>
><br>
>SIP isn't a full C++ parser - it doesn't know that the compiler will <br>
>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