Sponsored Content
Top Forums Programming static use for class inside the same class c++ Post 302684591 by xavipoes on Thursday 9th of August 2012 07:18:12 PM
Old 08-09-2012
so it just avoids name clashes, associating it with a class, but it still is global.
yes right, i understand what you mean Smilie, just one more thing,
if for instance there were two static members of different classes, both static int i, there woud also be two addresses in the program's static area. int Egg::i and int Shell::i.
In the case above, wouldnt it create a global Egg e, which also contains another global Egg e, Egg::Egg::e?
Thanks a million, i can imagine how hard it is to explain this
 

10 More Discussions You Might Find Interesting

1. Programming

Unix Class

I'm trying to put together a summer class for me and a few of my classmates. The class will be given a credit this fall. The Topic will be Unix Network Programming for Unix. We will have some IBM R6000's to work on, with AIX 4.2 and/or yellow dog (as yet to be determined if/how much a role each... (1 Reply)
Discussion started by: thmnetwork
1 Replies

2. UNIX Desktop Questions & Answers

It's first class!

This is a great sight! Excellent site, added to favorites!! I am also webmaster and I like this one!Thank you! (0 Replies)
Discussion started by: Leksej
0 Replies

3. UNIX Desktop Questions & Answers

It's first class!

Hi..!!!You have a very nice web-site! Good work!I am also webmaster and I like this one!Thank you! (1 Reply)
Discussion started by: Hardan
1 Replies

4. UNIX for Dummies Questions & Answers

car class (not school class)

im just trying to have some fun and kill some time writing a c++ program that has a person type in a car make and model then gives them a year and a price. or something like that. i always have problems getting it goin but once the ball is rolling im usually pretty good. anyone wanna help me out? ... (1 Reply)
Discussion started by: rickym2626
1 Replies

5. Programming

C++ class definition with a member of the same class

Hi, i have a question about C++. Is it possible to declare a class with a member ot the same class? For example, a linked list or i want to convert this C code to C++ class (Elemento) typedef struct elemento { char name; char value; List<struct elemento> ltElementos; ... (7 Replies)
Discussion started by: pogdorica
7 Replies

6. Shell Programming and Scripting

Perl class help

cat a.pl #!/usr/bin/perl package Myperlclass; sub mysub{ my $class; $class=shift; my $self{}; bless $self,$class; return $self; } sub add{ my $a,$b,$res; $a=$_; $b=$_; $res=$a+$b; print "res: $res\n"; } (0 Replies)
Discussion started by: cola
0 Replies

7. UNIX for Advanced & Expert Users

Get pointer for existing device class (struct class) in Linux kernel module

Hi all! I am trying to register a device in an existing device class, but I am having trouble getting the pointer to an existing class. I can create a class in a module, get the pointer to it and then use it to register the device with: *cl = class_create(THIS_MODULE, className);... (0 Replies)
Discussion started by: hdaniel@ualg.pt
0 Replies

8. Programming

Size of Derived class, upon virtual base class inheritance

I have the two class definition as follows. class A { public: int a; }; class B : virtual public A{ }; The size of class A is shown as 4, and size of class B is shown as 16. Why is this effect ?. (2 Replies)
Discussion started by: techmonk
2 Replies

9. Programming

C++ : Base class member function not accessible from derived class

Hello All, I am a learner in C++. I was testing my inheritance knowledge with following piece of code. #include <iostream> using namespace std; class base { public : void display() { cout << "In base display()" << endl; } void display(int k) {... (2 Replies)
Discussion started by: anand.shah
2 Replies

10. Programming

Array initialization inside class in C++

const int VALUES = {7,4,2,1,0}; //or int VALUES = {7,4,2,1,0};this statement inside a class definition gives error. Why? (3 Replies)
Discussion started by: milhan
3 Replies
SoWWWAnchor(3)							       Coin							    SoWWWAnchor(3)

NAME
SoWWWAnchor - The SoWWWAnchor class adds URL callbacks to the highlighted geometry. In addition to highlighting geometry under the cursor, the application programmer can set callbacks. It is possible to set one callback for picking, the fetch callback, and one callback for highlighting. SYNOPSIS
#include <Inventor/nodes/SoWWWAnchor.h> Inherits SoLocateHighlight. Public Types enum Mapping { NONE, POINT } Public Member Functions virtual SoType getTypeId (void) const SoWWWAnchor (void) void setFullURLName (const SbString &url) const SbString & getFullURLName (void) virtual void handleEvent (SoHandleEventAction *action) Static Public Member Functions static SoType getClassTypeId (void) static void initClass (void) static void setFetchURLCallBack (SoWWWAnchorCB *f, void *userData) static void setHighlightURLCallBack (SoWWWAnchorCB *f, void *userData) Public Attributes SoSFString name SoSFString description SoSFEnum map Protected Member Functions virtual const SoFieldData * getFieldData (void) const virtual ~SoWWWAnchor () virtual void redrawHighlighted (SoAction *act, SbBool isNowHighlighting) Static Protected Member Functions static const SoFieldData ** getFieldDataPtr (void) Detailed Description The SoWWWAnchor class adds URL callbacks to the highlighted geometry. In addition to highlighting geometry under the cursor, the application programmer can set callbacks. It is possible to set one callback for picking, the fetch callback, and one callback for highlighting. #Inventor V2.1 ascii WWWAnchor { name "http://www.coin3d.org/Coin/egg.iv" description "Easter Egg" Separator { Transform { scaleFactor 0.8 1.2 0.8 } Sphere { } } }.fi FILE FORMAT/DEFAULTS: WWWAnchor { renderCaching AUTO boundingBoxCaching AUTO renderCulling AUTO pickCulling AUTO color 0.3 0.3 0.3 style EMISSIVE mode AUTO name '<Undefined URL>' description '' map NONE } Since: Inventor 2.1 Member Enumeration Documentation enum SoWWWAnchor::Mapping Enum that says how a picked node's position should be mapped to the URL. Enumerator: NONE The position of the picked node is not mapped to the URL. POINT The position of the picked node is mapped to the URL as object space coordinates, adding a parameter string to the end of the URL. To assure that the URL works with all browsers, the coordinates are divided by commas sent as the hex representation. If a model by the name of sim.wrl resided at www.coin3d.org and the picked point had the coordinates [1.5, 10, 6.77], the resulting URL would be 'http://www.coin3d.org/sim.wrl?1.5%2c10%2c6.77'. Constructor &; Destructor Documentation SoWWWAnchor::SoWWWAnchor (void) Constructor. SoWWWAnchor::~SoWWWAnchor () [protected], [virtual] Destructor. Member Function Documentation SoType SoWWWAnchor::getClassTypeId (void) [static] This static method returns the SoType object associated with objects of this class. Reimplemented from SoLocateHighlight. SoType SoWWWAnchor::getTypeId (void) const [virtual] Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting. Usage example: void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all subclasses. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on. For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups. Reimplemented from SoLocateHighlight. const SoFieldData ** SoWWWAnchor::getFieldDataPtr (void) [static], [protected] This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Reimplemented from SoLocateHighlight. const SoFieldData * SoWWWAnchor::getFieldData (void) const [protected], [virtual] Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL. Reimplemented from SoLocateHighlight. void SoWWWAnchor::initClass (void) [static] Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system. Reimplemented from SoLocateHighlight. void SoWWWAnchor::setFullURLName (const SbString &url) Sets the full URL to url. If this is set, this URL will be used in callbacks instead of the URL set in SoWWWAnchor::name. See also: SoWWWAnchor::getFullURLName() const SbString & SoWWWAnchor::getFullURLName (void) Returns the full URL if it's set by SoWWWAnchor::setFullURLName(). Otherwise the contents of SoWWWAnchor::name is returned. See also: SoWWWAnchor::setFullURLName() void SoWWWAnchor::handleEvent (SoHandleEventAction *action) [virtual] Action method for SoHandleEventAction. Inspects the event data from action, and processes it if it is something which this node should react to. Nodes influencing relevant state variables for how event handling is done also overrides this method. Reimplemented from SoLocateHighlight. void SoWWWAnchor::setFetchURLCallBack (SoWWWAnchorCB *f, void *userData) [static] Sets the callback function f that is called when a SoWWWAnchor node is clicked on. This callback can among other things be used to provide a browser with the URL of this node. The callback will be called with the URL, userData and a pointer to this node as arguments. void SoWWWAnchor::setHighlightURLCallBack (SoWWWAnchorCB *f, void *userData) [static] Sets the callback function f that is called when a SoWWWAnchor node is highlighted. This callback can among other things be used to provide the user with a visual clue on which URL the node points to, for example by showing the URL as a string. The callback will be called with the URL, userData and a pointer to this node as arguments. void SoWWWAnchor::redrawHighlighted (SoAction *act, SbBoolisNowHighlighting) [protected], [virtual] Calls the highlight callback set up with SoWWWAnchor::setHighlightURLCallBack(). Reimplemented from SoLocateHighlight. Member Data Documentation SoSFString SoWWWAnchor::name The name of the URL which the anchor points to. SoSFString SoWWWAnchor::description The description of the URL. SoSFEnum SoWWWAnchor::map Enum describing how a node's position should be mapped to the URL. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoWWWAnchor(3)
All times are GMT -4. The time now is 02:02 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy