Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jafyvilla
Copy link
Contributor

Notify changes by calling notifyUpdated()
after the object has been changed (and not before).
Remove notifyChanging().

Generate doxygen documentation automatically for setters and
reference getters.

rhs.getZerobufNumDynamics( )));
uint32_t& version = rhs._allocator->getItem< uint32_t >( 0 );
version = ZEROBUF_VERSION_ABI;
rhs.notifyUpdated();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about that. The new values will be undefined, so I'm not sure how useful it is to signal the change. Users should stop using a moved object anyway.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, this is one of the questions I have about the code (I just moved down the notify call). That's why I had not assigned anyone yet...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is indeed strange. I would expect (this->)notifyChanging()...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, it should be removed. For the constructor (this->)notifyChanging() has no effect in any case because nothing can be connected to it already.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I removed it. This PR has been blocked for now (trying to find a general solution in HBPVIS/Servus#53)

@dnachbaur
Copy link
Contributor

Updated and Changed (what Changing should have been initially) are potentially two different things. From the way we used it today: Updated happens after a 'remote' change (subscriber, http server, load from file) on the object, where as Changed on every set/modification on the local object instance. This Changed state is vital for a 'dirty' tracking (c.f. Collage, save to file, ...), which could potentially lead to an endless (re-)distribution between two applications.

@rdumusc
Copy link

rdumusc commented Apr 18, 2016

@tribal-tec yes exactly. Updated should only be emitted for remote changes, probably by the servus::Serializable direcly in the _fromJSON and _fromBinary, and the function can be made private then.
For the local tracking of changed state (dirty bit) it is only use by collage currently, but could also be used for sending partial updates in the future (I'm thinking of the Livre "frame" event here) if we keep track of which field was modified locally. I don't know at which level of the class hierarchy it should be kept.

notifyChanging();
_allocator->copyBuffer( rhs._allocator->getData(),
rhs._allocator->getSize( ));
notifyChanged();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still useless in constructor IMHO

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack, but this is the assignment operator.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops my bad, github had collapsed the two functions..!

return "uint32_t" if self.is_zerobuf_type or self.is_enum_type else self.type


"""Doxygen documentation for C++ functions"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move below class declaration. Python docstrings are after the declaration.

@eile
Copy link
Contributor

eile commented Apr 25, 2016

+1

Notify changes by calling Servus::serializable::notifyChanged()
after the object has been changed (and not before).

Generate doxygen documentation automatically for setters and
reference getters.
@jafyvilla jafyvilla merged commit 83501b2 into HBPVIS:master Apr 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants