Changeset 64:4ab6b4fce96a in finroc_plugins_data_ports


Ignore:
Timestamp:
03.04.2014 14:55:30 (5 years ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
default
Phase:
public
Message:

Small patch: if DELETED flag is passed to port wrapper constructor, no port is created

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tPort.h

    r63 r64  
    150150    tConstructorArguments<tPortCreationInfo<T>> creation_info(arg1, arg2, args...); 
    151151    creation_info.data_type = rrlib::rtti::tDataType<tPortBuffer>(); 
    152     SetWrapped(tImplementation::CreatePort(creation_info)); 
    153     GetWrapped()->SetWrapperDataType(rrlib::rtti::tDataType<T>()); 
    154     if (creation_info.DefaultValueSet()) 
     152    if (!(creation_info.flags.Raw() & core::tFrameworkElementFlags(core::tFrameworkElementFlag::DELETED).Raw())) // do not create port, if deleted flag is set 
    155153    { 
    156       T t(rrlib::serialization::DefaultInstantiation<T>::Create()); 
    157       creation_info.GetDefault(t); 
    158       SetDefault(t); 
     154      SetWrapped(tImplementation::CreatePort(creation_info)); 
     155      GetWrapped()->SetWrapperDataType(rrlib::rtti::tDataType<T>()); 
     156      if (creation_info.DefaultValueSet()) 
     157      { 
     158        T t(rrlib::serialization::DefaultInstantiation<T>::Create()); 
     159        creation_info.GetDefault(t); 
     160        SetDefault(t); 
     161      } 
    159162    } 
    160163  } 
Note: See TracChangeset for help on using the changeset viewer.