Capital Letter Function

Jun 6, 2011 at 2:42pm
Hi,
Could anyone please tell me what does a function in capital(all capital) letters indicate?

I have a cpp file which exports function.At the end of it there is a function call(which contain all capital letter and a name which is probably an inline or header file without any inverted commas as argument).I searched for it in all included headerfile but its not defined anywhere.I think its related to inline file because one such file is included in it.The program compiles fine.Could anyone please help?

Thanks.
Jun 6, 2011 at 2:55pm
Could anyone please tell me what does a function in capital(all capital) letters indicate?


Usually it's a macro. Basically it's not really a function, but rather it will expand to larger code when you compile it.

without any inverted commas as argument


What are inverted commas? =x

I searched for it in all included headerfile but its not defined anywhere


You must have missed it. Everything other than built in language keywords are defined somewhere.



It would help if you told us the actual name of the function in question (and possibly showed us an example)
Jun 6, 2011 at 7:36pm
- A function in all capitol letters is just a naming convention, it has no actual influence on the outcome of the code.

- An inverted comma? σ_σ Do you mean an Apostrophe?

- The function could be included from a header that is included in one of the headers. It could also have been imported from a DLL. Is this a dump from an application that is in common usage? Maybe one of us can tell you what it is.
Jun 6, 2011 at 9:06pm
#include <sofa/component/controller/LCPForceFeedback.inl>
#include <sofa/core/ObjectFactory.h>
#include <sofa/helper/LCPcalc.h>
#include <sofa/defaulttype/RigidTypes.h>

using namespace std;
using namespace sofa::defaulttype;

namespace sofa
{
namespace component
{
namespace controller
{
int lCPForceFeedbackClass = sofa::core::RegisterObject("LCP force feedback for the omni")
#ifndef SOFA_FLOAT
.add< LCPForceFeedback<sofa::defaulttype::Vec1dTypes> >()
.add< LCPForceFeedback<sofa::defaulttype::Rigid3dTypes> >()
#endif
#ifndef SOFA_DOUBLE
.add< LCPForceFeedback<sofa::defaulttype::Vec1fTypes> >()
.add< LCPForceFeedback<sofa::defaulttype::Rigid3fTypes> >()
#endif
;

#ifndef SOFA_FLOAT
template class SOFA_COMPONENT_CONTROLLER_API LCPForceFeedback<Vec1dTypes>;
template class SOFA_COMPONENT_CONTROLLER_API LCPForceFeedback<Rigid3dTypes>;
#endif
#ifndef SOFA_DOUBLE
template class SOFA_COMPONENT_CONTROLLER_API LCPForceFeedback<Vec1fTypes>;
template class SOFA_COMPONENT_CONTROLLER_API LCPForceFeedback<Rigid3fTypes>;
#endif
SOFA_DECL_CLASS(LCPForceFeedback)


} // namespace controller
} // namespace component
} // namespace sofa



OK this is the code.SOFA_DECL_CLASS(LCPForceFeedback) is my problem.I searched for it in all header files and its nowhere. I dont know what it is?

Jun 6, 2011 at 10:03pm
Yes, that is a macro.

Somewhere there is a line that says

 
#define SOFA_DECL_CLASS( someidentifier) ... 


With a bunch of stuff following it.


But really, instead of looking for it in code, you're better off reading sofa documentation and finding out what the LCPForceFeedback class does.
Jun 6, 2011 at 10:24pm
Thanks for the reply.

I was looking at the documentation page and I found this thing I dont know how.So, is there anyway to find this
#define SOFA_DECL_CLASS( someidentifier) ...
in the whole project?

I know what this class does but I was just curious.

Anyway thanks.
Topic archived. No new replies allowed.