Sponsored Content
Top Forums Programming How to return void function pointer Post 302177684 by ramen_noodle on Saturday 22nd of March 2008 04:01:46 PM
Old 03-22-2008
 

10 More Discussions You Might Find Interesting

1. Programming

Problem with function which reutrns pointer to a value

i have a function: char *pcCityIdToCountryName(ADMIN_DB_DATA *pstHEader, unit uiCityID) this returns a pointer to CountryName if cityId is given. to retrieve countryname i give: char *CountryName; CountryName = pcCityIdToCountryName(..................); but when i compile it is giving :... (5 Replies)
Discussion started by: jazz
5 Replies

2. Programming

pass a pointer-to-pointer, or return a pointer?

If one wants to get a start address of a array or a string or a block of memory via a function, there are at least two methods to achieve it: (1) one is to pass a pointer-to-pointer parameter, like: int my_malloc(int size, char **pmem) { *pmem=(char *)malloc(size); if(*pmem==NULL)... (11 Replies)
Discussion started by: aaronwong
11 Replies

3. Programming

Function pointer to inline function ?

Hi. Problem: I have to parse the payload of a packet. The payload could be in Big Endian Format (network byte order) or little. That depends on a flag present in the header of the packet. Solution: A horrible solution could be to check for that flag everytime I have to read a field in the... (11 Replies)
Discussion started by: emitrax
11 Replies

4. Programming

Function Returning Pointer

Hi guys. how a functions such fdopen, ... can return pointer? are these functions use static memory(variables)? (6 Replies)
Discussion started by: majid.merkava
6 Replies

5. HP-UX

converting void pointer to pthread_t on HPUX Itanium

i am trying to convert void pointer to pthread_t on hpux-itanium 64 bit which fails as below "src/file.cpp", line 88: error #2171: invalid type conversion pthread_t tid = reinterpret_cast<pthread_t>(m_threadId); 1 error detected in the compilation of "src/file.cpp" ... (0 Replies)
Discussion started by: skyineyes
0 Replies

6. Programming

void pointer

hi guys! Is there such a thing as double void pointer dynamic allocation? And if so is it something like this? int n; void** a; a=malloc(n*sizeof(void*)); (12 Replies)
Discussion started by: vlm
12 Replies

7. Programming

Parameter passing to function with void * as Argument

Earlier I had one structure C typedef struct c { int cc; }CS; I used to call a library function say int GetData(CS *x) which was returning me the above structure C with data. GetData(CS *x) Function call used to be like: CS CSobj; GetData(&CSObj); Now there are two... (12 Replies)
Discussion started by: rupeshkp728
12 Replies

8. Programming

Malloc to void pointer fails

I have a function to which I will pass a struct ID and it will return me a string. I will pass a pointer to store the name string and that pointer will be allocated memory by the function called. int ConvertIDToName(void *id, void *name, size_t *size) { int status = 0; ... (5 Replies)
Discussion started by: rupeshkp728
5 Replies

9. Shell Programming and Scripting

Return: can only `return' from a function or sourced script

Not sure where the problem is. I can run the script without any issue using the following command. . /opt/app/scripts/cdc_migration.sh But it fails with the below error when I try it this way /opt/app/scripts/cdc_migration.sh /opt/app/scripts/cdc_migration.sh: line 65: return: can only... (1 Reply)
Discussion started by: svajhala
1 Replies

10. Shell Programming and Scripting

Function - Make your function return an exit status

Hi All, Good Day, seeking for your assistance on how to not perform my 2nd, 3rd,4th etc.. function if my 1st function is in else condition. #Body function1() { if then echo "exist" else echo "not exist" } #if not exist in function1 my all other function will not proceed.... (4 Replies)
Discussion started by: meister29
4 Replies
SoSensor(3)							       Coin							       SoSensor(3)

NAME
SoSensor - The SoSensor class is the abstract base class for all sensors. Sensors is a mechanism in Coin for scheduling jobs to be run upon specific events. The events in question could be particular points in time, or changes to entities in the scene graph. SYNOPSIS
#include <Inventor/sensors/SoSensor.h> Inherited by SoDelayQueueSensor, and SoTimerQueueSensor. Public Member Functions SoSensor (void) SoSensor (SoSensorCB *func, void *data) virtual ~SoSensor (void) void setFunction (SoSensorCB *callbackfunction) SoSensorCBPtr getFunction (void) const void setData (void *callbackdata) void * getData (void) const virtual void schedule (void)=0 virtual void unschedule (void)=0 virtual SbBool isScheduled (void) const =0 virtual void trigger (void) virtual SbBool isBefore (const SoSensor *s) const =0 void setNextInQueue (SoSensor *next) SoSensor * getNextInQueue (void) const Static Public Member Functions static void initClass (void) Protected Attributes SoSensorCB * func void * funcData Detailed Description The SoSensor class is the abstract base class for all sensors. Sensors is a mechanism in Coin for scheduling jobs to be run upon specific events. The events in question could be particular points in time, or changes to entities in the scene graph. See documentation of subclasses for insight into exactly for what types of events we can trigger sensor callbacks. For most tasks where application programmers can use sensors, it is also possible to achieve the same results by using engines. There are a few important differences between sensors and engines, though: Engines are considered part of the scene graph, and is written to file upon SoWriteAction export operations. Sensors, on the other hand, are not included in export operations. Engines basically connects fields (and comes with a lot of builtin functionality for combining and converting inputs and outputs), you just decide which engine you want, connect inputs and output and forgets about it. Sensors are a lot more flexible in what you can do when they trigger, as control is transfered internally from Coin to your registered callback functions. See also: SoSensorManager, SoEngine Constructor &; Destructor Documentation SoSensor::SoSensor (void) Constructor. SoSensor::SoSensor (SoSensorCB *funcptr, void *data) Constructor taking as parameters the sensor callback function func and the user data pointer which will be passed the callback. See also: setFunction(), setData() SoSensor::~SoSensor (void) [virtual] Destructor. Member Function Documentation void SoSensor::setFunction (SoSensorCB *callbackfunction) Set the callback function pointer which will be used when the sensor is triggered. See also: getFunction(), setData() SoSensorCB * SoSensor::getFunction (void) const Returns the callback function pointer. See also: setFunction() void SoSensor::setData (void *callbackdata) Set the user-supplied data pointer which will be used as the first argument to the sensor callback function. See also: getData(), setFunction() void * SoSensor::getData (void) const Returns the user-supplied callback function data pointer. See also: setData() void SoSensor::schedule (void) [pure virtual] Put the sensor in a queue to be triggered at a later time. See also: unschedule(), isScheduled() Implemented in SoDelayQueueSensor, SoTimerSensor, SoAlarmSensor, and SoTimerQueueSensor. void SoSensor::unschedule (void) [pure virtual] Remove sensor from queue. The sensor will not be triggered unless it is later rescheduled. See also: schedule(), isScheduled() Implemented in SoDelayQueueSensor, SoTimerSensor, and SoTimerQueueSensor. SbBool SoSensor::isScheduled (void) const [pure virtual] Check if this sensor is scheduled for triggering. See also: schedule(), unschedule() Implemented in SoDelayQueueSensor, and SoTimerQueueSensor. void SoSensor::trigger (void) [virtual] Trigger the sensor's callback function. Reimplemented in SoDataSensor, SoDelayQueueSensor, SoTimerQueueSensor, and SoFieldSensor. SbBool SoSensor::isBefore (const SoSensor *s) const [pure virtual] Returns TRUE if this sensor should precede sensor s in its sensor queue. void SoSensor::setNextInQueue (SoSensor *next) This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Open Inventor function not implemented in Coin. SoSensor * SoSensor::getNextInQueue (void) const This API member is considered internal to the library, as it is not likely to be of interest to the application programmer. Open Inventor function not implemented in Coin. void SoSensor::initClass (void) [static] Sets up initialization for static data for the sensors. Called by SoDB::init(). Member Data Documentation SoSensorCB * SoSensor::func [protected] Function to be called when a sensor triggers. void * SoSensor::funcData [protected] Data passed to the callback function. Author Generated automatically by Doxygen for Coin from the source code. Version 3.1.3 Wed May 23 2012 SoSensor(3)
All times are GMT -4. The time now is 07:20 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy