-
Notifications
You must be signed in to change notification settings - Fork 15
Fix notifyUpdated usage #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| # -*- mode: cmake -*- | ||
| git_subproject(Servus https://github.com/HBPVIS/Servus.git 62873a5) | ||
| git_subproject(Servus https://github.com/HBPVIS/Servus.git 9fb8f08) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,7 +30,6 @@ Zerobuf::Zerobuf( AllocatorPtr alloc ) | |
|
|
||
| Zerobuf::Zerobuf( Zerobuf&& rhs ) | ||
| { | ||
| rhs.notifyChanging(); | ||
| _allocator = std::move( rhs._allocator ); | ||
| rhs._allocator.reset( new NonMovingAllocator( rhs.getZerobufStaticSize(), | ||
| rhs.getZerobufNumDynamics( ))); | ||
|
|
@@ -49,9 +48,9 @@ Zerobuf& Zerobuf::operator = ( const Zerobuf& rhs ) | |
| if( getTypeIdentifier() != rhs.getTypeIdentifier( )) | ||
| throw std::runtime_error( "Can't assign Zerobuf of a different type" ); | ||
|
|
||
| notifyChanging(); | ||
| _allocator->copyBuffer( rhs._allocator->getData(), | ||
| rhs._allocator->getSize( )); | ||
| notifyChanged(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. still useless in constructor IMHO
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ack, but this is the assignment operator. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. oops my bad, github had collapsed the two functions..! |
||
| return *this; | ||
| } | ||
|
|
||
|
|
@@ -63,17 +62,15 @@ Zerobuf& Zerobuf::operator = ( Zerobuf&& rhs ) | |
| if( getTypeIdentifier() != rhs.getTypeIdentifier( )) | ||
| throw std::runtime_error( "Can't assign Zerobuf of a different type" ); | ||
|
|
||
| notifyChanging(); | ||
| rhs.notifyChanging(); | ||
|
|
||
| if( _allocator->isMovable() && rhs._allocator->isMovable( )) | ||
| _allocator = std::move( rhs._allocator ); | ||
| else // Sub allocator data can't be moved - need to copy | ||
| _allocator->copyBuffer( rhs._allocator->getData(), | ||
| rhs._allocator->getSize( )); | ||
|
|
||
| rhs._allocator.reset( new NonMovingAllocator( rhs.getZerobufStaticSize(), | ||
| rhs.getZerobufNumDynamics( ))); | ||
| rhs.getZerobufNumDynamics())); | ||
| notifyChanged(); | ||
| return *this; | ||
| } | ||
|
|
||
|
|
@@ -103,8 +100,8 @@ bool Zerobuf::_fromBinary( const void* data, const size_t size ) | |
| return false; | ||
| } | ||
|
|
||
| notifyChanging(); | ||
| _allocator->copyBuffer( data, size ); | ||
| notifyChanged(); | ||
| return true; | ||
| } | ||
|
|
||
|
|
@@ -135,7 +132,6 @@ bool Zerobuf::_fromJSON( const std::string& string ) | |
| return false; | ||
| } | ||
|
|
||
| notifyChanging(); | ||
| _parseJSON( json ); | ||
| compact(); | ||
| return true; | ||
|
|
@@ -189,7 +185,6 @@ Allocator& Zerobuf::getAllocator() | |
| if( !_allocator ) | ||
| throw std::runtime_error( "Empty Zerobuf has no allocator" ); | ||
|
|
||
| notifyChanging(); | ||
| return *_allocator; | ||
| } | ||
|
|
||
|
|
@@ -208,7 +203,6 @@ void Zerobuf::_copyZerobufArray( const void* data, const size_t size, | |
| throw std::runtime_error( | ||
| "Can't copy data into empty Zerobuf object" ); | ||
|
|
||
| notifyChanging(); | ||
| void* array = _allocator->updateAllocation( arrayNum, false /*no copy*/, | ||
| size ); | ||
| ::memcpy( array, data, size ); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
too many 'value' in this sentence ;-)