Login
Username:

Password:


Lost Password?

Register now!
Main Menu
H3D.org Feeds
H3D.org Forum Index
   Programming Issues
     What is Inst< ?
Register To Post

Threaded | Newest First Previous Topic | Next Topic | Bottom
Poster Thread
Calador
Posted on: 2010/2/3 23:31
Joined: 2008/2/5
From:
Posts: 142
What is Inst< ?
Hi,
I am curious. What is 'Inst'. I am referring to the notation used in the H3DAPI include file constructors, like FalconDevice.h. Such as :
[code]
FalconDevice(
Inst< SFVec3f> _devicePosition = 0,
[\code]

I also noticed the underline "_", is that necessary as well?

I am not familiar with it, is it a standard C++ notation? It looks like a template wrapper for the data types that are being loaded into it.

Is this correct? Do you define 'Inst' in H3D, or is it standardly used elsewhere? and for what purpose? Something to do with converting C++ into python?

Any explanation would be greatly appreciated.
Markus
Posted on: 2010/2/5 16:05
Webmaster
Joined: 2006/3/27
From: SenseGraphics
Posts: 1531
Re: What is Inst< ?
From Instantiate.h where Inst is declared:

// Inst guarantees an instance of the class T if one
// isn't already given to the constructor. Used to
// ensure that Fields are initialised in the right
// constructor in the Nodes.
karlu
Posted on: 2010/2/8 8:45
Guru
Joined: 2004/12/2
From: Sweden
Posts: 585
Re: What is Inst< ?
I believe that it's a way of implementing the "Template Method" design pattern: any subclass is allowed to replace the functional blocks of their super classes by specifying a customized object. If not, then null is sent to the constructor and Inst automatically creates the default functional block.


----------------
KJ Lundin Palmerius
Norrköping Visualization and Interaction Studio
Linköping University, Sweden

Threaded | Newest First Previous Topic | Next Topic | Top

Register To Post
 



(C) 2004 SenseGraphics AB    ---    Powered by XOOPS