SOFA API  c4ac86de
Open source framework for multi-physics simuation
sofa Namespace Reference

This allow Base object to interact with the messaging system. More...

Namespaces

 component
 
 constraint
 
 core
 
 defaulttype
 
 helper
 
 simpleapi
 simpleapi
 
 simulation
 

Classes

struct  AdvancedTimerTest
 
struct  DefaultAnimationLoop_test
 
class  TemplateAliasTest
 

Functions

 TEST_F (TemplateAliasTest, Register)
 
template<class mat >
helper::OwnershipSPtr< mat > convertSPtr (const defaulttype::BaseMatrix *m)
 
 TEST_F (AdvancedTimerTest, IsEnabled)
 
 TEST_F (AdvancedTimerTest, SetOutputType)
 
 TEST_F (AdvancedTimerTest, End)
 
 TEST_F (DefaultAnimationLoop_test, testOneStep)
 

Detailed Description

This allow Base object to interact with the messaging system.

For SOFA_UNUSED.

This register the TriangleLoader object to the logging system so that we can use msg_*(this)

This allow MeshTrian to interact with the messaging system.

Forward declaration.

for std::pair

This line registers the DefaultMultiMatrixAccessor to the messaging system allowing to use msg_info() instead of msg_info("DefaultMultiMatrixAccessor")

For size_t For std::string For SOFA_HELPER_API

Helpers to apply Eigen matrix methods to the Mat sofa type

Utility to compute the sorted permutation of a container. See example at the end of the file Francois Faure, April 2012

This file organization:

  • PRIVATE DECLARATION (the class that are only used internally)
  • PRIVATE DEFINITION (the implementation of the private classes)
  • PUBLIC DEFINITION (the implementation of the public classes)

This file is providing an API to combine gtest and msg_* API. The underlying idea is to be able to test sofa's message.

The API is composed of two macro:

  • EXPECT_MSG_EMIT(...);
  • EXPECT_MSG_NOEMIT(...);

The first one generates a gtest failure when a message of a given type is not emitted. So You need to use it express that the good behavior from the object is to rise a message.

The second one generates a gtest failure when a message of a given type is emitted.

Examples of use: for(BaseLoader* b : objectlist) { EXPECT_MESSAGE_NOEMIT(Warning); EXPECT_MESSAGE_EMIT(Error); b->load("Invalid file"); }

To work the API need to a specific handler to be install in the messaging system. This means that we need to install the message handler using. This is not done automatically To not add something with a linear time complexity in the process.

Example of installation: MessageDispatcher::addHandler( MainGtestMessageHandler::getInstance() ) ;

NB: This is done automatically if you are inhering from Sofa_test.

Function Documentation

template<class mat >
helper::OwnershipSPtr<mat> sofa::convertSPtr ( const defaulttype::BaseMatrix m)

Converts a BaseMatrix to a eigen sparse matrix encapsulted in a OwnershipSPtr. It the conversion needs to create a temporary matrix, it will be automatically deleted by the OwnershipSPtr (with ownership). It the conversion did not create a temporary data, and points to an existing matrix, the OwnershipSPtr does not take the ownership and won't delete anything. move this somewhere else?

Author
Matthieu Nesme
sofa::TEST_F ( DefaultAnimationLoop_test  ,
testOneStep   
)
sofa::TEST_F ( TemplateAliasTest  ,
Register   
)
sofa::TEST_F ( AdvancedTimerTest  ,
IsEnabled   
)
sofa::TEST_F ( AdvancedTimerTest  ,
SetOutputType   
)
sofa::TEST_F ( AdvancedTimerTest  ,
End   
)