Skip to content

Commit

Permalink
Refs eProsima#1469. Added participant dispose mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
richiware committed Jan 25, 2016
1 parent b27c3db commit 95b3af0
Show file tree
Hide file tree
Showing 17 changed files with 76 additions and 32 deletions.
Binary file modified doc/README.odt
Binary file not shown.
Binary file modified doc/pdf/FASTRTPSGEN - User Manual.odt
Binary file not shown.
Binary file modified doc/pdf/Fast RTPS - Installation Manual.odt
Binary file not shown.
Binary file modified doc/pdf/Fast RTPS - User Manual.odt
Binary file not shown.
2 changes: 1 addition & 1 deletion doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ PROJECT_BRIEF = "@PROJECT_NAME_LARGE@"
# and the maximum width should not exceed 200 pixels. Doxygen will copy the logo
# to the output directory.

PROJECT_LOGO = @PROJECT_SOURCE_DIR@/utils/images/logo/eProsimaLogo.jpg
PROJECT_LOGO = @PROJECT_SOURCE_DIR@/utils/images/logo/eProsimaLogo.png

# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path
# into which the generated documentation will be written. If a relative path is
Expand Down
12 changes: 10 additions & 2 deletions fastrtpsgen/src/com/eprosima/fastrtps/idl/templates/VS2010.stg
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ project(solution, project, example, configurations, local) ::= <<
<PropertyGroup Label="UserMacros" />
$configurations:{<PropertyGroup Condition="'\$(Configuration)|\$(Platform)'=='$it.name$|$it.platform$'">
<IntDir>\$(Platform)\\\$(Configuration)\\\$(ProjectName)\</IntDir>
<OutDir>.\lib\\$example$\</OutDir>
<OutDir>.\\$if(!it.dll)$lib$else$bin$endif$\\$example$\</OutDir>
<TargetName>$if(!it.dll)$lib$endif$\$(ProjectName)$if(it.debug)$d$endif$</TargetName>
</PropertyGroup>};separator="\n"$
$configurations:{<ItemDefinitionGroup Condition="'\$(Configuration)|\$(Platform)'=='$it.name$|$it.platform$'">
Expand All @@ -60,15 +60,23 @@ project(solution, project, example, configurations, local) ::= <<
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<ProgramDataBaseFileName>\$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<ProgramDataBaseFileName>.\lib\\$example$\\\$(TargetName).pdb</ProgramDataBaseFileName>
$bigObjOption()$
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Shlwapi.lib;Iphlpapi.lib;$project.dependencies : {dep |$if(!it.dll)$lib$endif$$dep$Types$if(it.debug)$d$endif$.lib}; separator=";"$;$if(!it.dll)$WS2_32.lib;$endif$%(AdditionalDependencies)</AdditionalDependencies>
$if(it.dll)$
<OutputFile>\$(TargetDir)\$(TargetName)\$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$solution.libraryPaths : {path |$path$;}$.\lib\\$example$;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>.\lib\\$example$\\\$(TargetName).lib</ImportLibrary>
$endif$
</Link>
$if(!it.dll)$
<Lib>
<OutputFile>\$(TargetDir)\$(TargetName)\$(TargetExt)</OutputFile>
</Lib>
$endif$
</ItemDefinitionGroup>};separator="\n"$
<ItemGroup>
$project.commonSrcFiles : {srcfile |<ClCompile Include="$srcfile$" />}; separator="\n"$
Expand Down
16 changes: 12 additions & 4 deletions fastrtpsgen/src/com/eprosima/fastrtps/idl/templates/VS2013.stg
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ project(solution, project, example, configurations, local) ::= <<
<PropertyGroup Label="UserMacros" />
$configurations:{<PropertyGroup Condition="'\$(Configuration)|\$(Platform)'=='$it.name$|$it.platform$'">
<IntDir>\$(Platform)\\\$(Configuration)\\\$(ProjectName)\</IntDir>
<OutDir>.\lib\\$example$\</OutDir>
<OutDir>.\\$if(!it.dll)$lib$else$bin$endif$\\$example$\</OutDir>
<TargetName>$if(!it.dll)$lib$endif$\$(ProjectName)$if(it.debug)$d$endif$</TargetName>
</PropertyGroup>};separator="\n"$
$configurations:{<ItemDefinitionGroup Condition="'\$(Configuration)|\$(Platform)'=='$it.name$|$it.platform$'">
Expand All @@ -63,15 +63,23 @@ project(solution, project, example, configurations, local) ::= <<
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<PrecompiledHeaderFile>
</PrecompiledHeaderFile>
<ProgramDataBaseFileName>\$(TargetDir)\$(TargetName).pdb</ProgramDataBaseFileName>
<ProgramDataBaseFileName>.\lib\\$example$\\\$(TargetName).pdb</ProgramDataBaseFileName>
$bigObjOption()$
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>Shlwapi.lib;Iphlpapi.lib;$project.dependencies : {dep |$if(!it.dll)$lib$endif$$dep$Types$if(it.debug)$d$endif$.lib}; separator=";"$;$if(!it.dll)$WS2_32.lib;$endif$%(AdditionalDependencies)</AdditionalDependencies>
$if(it.dll)$
<OutputFile>\$(TargetDir)\$(TargetName)\$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$solution.libraryPaths : {path |$path$;}$.\lib\\$example$;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>.\lib\\$example$\\\$(TargetName).lib</ImportLibrary>
$endif$
</Link>
$if(!it.dll)$
<Lib>
<OutputFile>\$(TargetDir)\$(TargetName)\$(TargetExt)</OutputFile>
</Lib>
$endif$
</ItemDefinitionGroup>};separator="\n"$
<ItemGroup>
$project.commonSrcFiles : {srcfile |<ClCompile Include="$srcfile$" />}; separator="\n"$
Expand Down Expand Up @@ -180,7 +188,7 @@ projectJNI(solution, project, example, configurations, local) ::= <<
<PropertyGroup Label="UserMacros" />
$configurations:{<PropertyGroup Condition="'\$(Configuration)|\$(Platform)'=='$it.name$|$it.platform$'">
<IntDir>\$(Platform)\\\$(Configuration)\\\$(ProjectName)\</IntDir>
<OutDir>.\lib\\$example$\</OutDir>
<OutDir>.\\$if(!it.dll)$lib$else$bin$endif$\\$example$\</OutDir>
<TargetName>$if(!it.dll)$lib$endif$\$(ProjectName)$if(it.debug)$d$endif$</TargetName>
</PropertyGroup>};separator="\n"$
$configurations:{<ItemDefinitionGroup Condition="'\$(Configuration)|\$(Platform)'=='$it.name$|$it.platform$'">
Expand Down Expand Up @@ -211,7 +219,7 @@ projectJNI(solution, project, example, configurations, local) ::= <<
$if(it.dll)$
<OutputFile>\$(TargetDir)\$(TargetName)\$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>$solution.libraryPaths : {path |$path$;}$.\lib\\$example$;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<ImportLibrary>\$(TargetDir)\$(TargetName).lib</ImportLibrary>
<ImportLibrary>.\lib\\$example$\\\$(TargetName).lib</ImportLibrary>
$endif$
</Link>
$if(!it.dll)$
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class PDPSimple {
* Force the sending of our local DPD to all remote RTPSParticipants and multicast Locators.
* @param new_change If true a new change (with new seqNum) is created and sent; if false the last change is re-sent
*/
void announceParticipantState(bool new_change);
void announceParticipantState(bool new_change, bool dispose = false);
//!Stop the RTPSParticipantAnnouncement (only used in tests).
void stopParticipantAnnouncement();
//!Reset the RTPSParticipantAnnouncement (only used in tests).
Expand Down
3 changes: 3 additions & 0 deletions src/cpp/rtps/builtin/BuiltinProtocols.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ BuiltinProtocols::BuiltinProtocols():
}

BuiltinProtocols::~BuiltinProtocols() {
// Send participant is disposed
if(mp_PDP != nullptr)
mp_PDP->announceParticipantState(true, true);
// TODO Auto-generated destructor stub
if(mp_WLP!=nullptr)
delete(mp_WLP);
Expand Down
6 changes: 3 additions & 3 deletions src/cpp/rtps/builtin/data/ParticipantProxyData.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,12 @@ bool ParticipantProxyData::initializeData(RTPSParticipantImpl* part,PDPSimple* p
this->m_defaultMulticastLocatorList = part->getAttributes().defaultMulticastLocatorList;
this->m_expectsInlineQos = false;
this->m_guid = part->getGuid();
for(uint8_t i =0;i<16;++i)
for(uint8_t i = 0; i<16; ++i)
{
if(i<12)
this->m_key.value[i] = m_guid.guidPrefix.value[i];
if(i>=16)
this->m_key.value[i] = m_guid.entityId.value[i];
else
this->m_key.value[i] = m_guid.entityId.value[i - 12];
}


Expand Down
62 changes: 42 additions & 20 deletions src/cpp/rtps/builtin/discovery/participant/PDPSimple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,35 +142,57 @@ void PDPSimple::resetParticipantAnnouncement()
mp_resendParticipantTimer->restart_timer();
}

void PDPSimple::announceParticipantState(bool new_change)
void PDPSimple::announceParticipantState(bool new_change, bool dispose)
{
const char* const METHOD_NAME = "announceParticipantState";
logInfo(RTPS_PDP,"Announcing RTPSParticipant State (new change: "<< new_change <<")",C_CYAN);
CacheChange_t* change = nullptr;
if(new_change || m_hasChangedLocalPDP)
{
this->getLocalParticipantProxyData()->m_manualLivelinessCount++;
if(mp_SPDPWriterHistory->getHistorySize() > 0)
mp_SPDPWriterHistory->remove_min_change();
change = mp_SPDPWriter->new_change(ALIVE,getLocalParticipantProxyData()->m_key);
if(getLocalParticipantProxyData()->toParameterList())
{

if(!dispose)
{
if(new_change || m_hasChangedLocalPDP)
{
this->getLocalParticipantProxyData()->m_manualLivelinessCount++;
if(mp_SPDPWriterHistory->getHistorySize() > 0)
mp_SPDPWriterHistory->remove_min_change();
change = mp_SPDPWriter->new_change(ALIVE,getLocalParticipantProxyData()->m_key);
if(getLocalParticipantProxyData()->toParameterList())
{
#if EPROSIMA_BIG_ENDIAN
change->serializedPayload.encapsulation = (uint16_t)PL_CDR_BE;
#else
change->serializedPayload.encapsulation = (uint16_t)PL_CDR_LE;
#endif
change->serializedPayload.length = (uint16_t)getLocalParticipantProxyData()->m_QosList.allQos.m_cdrmsg.length;
//TODO Optimizacion, intentar quitar la copia.
memcpy(change->serializedPayload.data,getLocalParticipantProxyData()->m_QosList.allQos.m_cdrmsg.buffer,change->serializedPayload.length);
mp_SPDPWriterHistory->add_change(change);
}
m_hasChangedLocalPDP = false;
}
else
{
mp_SPDPWriter->unsent_changes_reset();
}
}
else
{
if(mp_SPDPWriterHistory->getHistorySize() > 0)
mp_SPDPWriterHistory->remove_min_change();
change = mp_SPDPWriter->new_change(NOT_ALIVE_DISPOSED_UNREGISTERED, getLocalParticipantProxyData()->m_key);
if(getLocalParticipantProxyData()->toParameterList())
{
#if EPROSIMA_BIG_ENDIAN
change->serializedPayload.encapsulation = (uint16_t)PL_CDR_BE;
#else
change->serializedPayload.encapsulation = (uint16_t)PL_CDR_LE;
#endif
change->serializedPayload.length = (uint16_t)getLocalParticipantProxyData()->m_QosList.allQos.m_cdrmsg.length;
//TODO Optimizacion, intentar quitar la copia.
memcpy(change->serializedPayload.data,getLocalParticipantProxyData()->m_QosList.allQos.m_cdrmsg.buffer,change->serializedPayload.length);
mp_SPDPWriterHistory->add_change(change);
}
m_hasChangedLocalPDP = false;
}
else
{
mp_SPDPWriter->unsent_changes_reset();
}
change->serializedPayload.length = (uint16_t)getLocalParticipantProxyData()->m_QosList.allQos.m_cdrmsg.length;
//TODO Optimizacion, intentar quitar la copia.
memcpy(change->serializedPayload.data,getLocalParticipantProxyData()->m_QosList.allQos.m_cdrmsg.buffer,change->serializedPayload.length);
mp_SPDPWriterHistory->add_change(change);
}
}

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ void PDPSimpleListener::onNewCacheChangeAdded(RTPSReader* reader, const CacheCha
}
else
{
//pWarning("Implement CHANGE KIND NOT ALIVE IN SPDPLISTENER"<<endl);
GUID_t guid;
iHandle2GUID(guid,change->instanceHandle);
this->mp_SPDP->removeRemoteParticipant(guid);
Expand Down
4 changes: 4 additions & 0 deletions utils/doxygen/pages/customdoxygen.css
Original file line number Diff line number Diff line change
Expand Up @@ -845,6 +845,7 @@ dl.bug
#projectlogo img
{
border: 0px none;
width: 400px
}

#projectname
Expand Down Expand Up @@ -947,3 +948,6 @@ dl.citelist dd {
}
}

div.image img[src="eProsimaLogo.png"] {
width: 300px
}
Binary file modified utils/images/icon/eprosima_icon.bmp
Binary file not shown.
Binary file modified utils/images/icon/eprosima_icon.ico
Binary file not shown.
Binary file modified utils/images/logo/eProsimaLogo.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added utils/images/logo/eProsimaLogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 95b3af0

Please sign in to comment.