Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   C++ (http://www.velocityreviews.com/forums/f39-c.html)
-   -   compilation dependencies .. (http://www.velocityreviews.com/forums/t268134-compilation-dependencies.html)

Anand 07-08-2003 11:52 AM

compilation dependencies ..
 
I've a singleton object declaration in C++ in which there are other
classes' POINTERS declared as private members as shown below.

// CSingleton.h

Class Singleton
{

private:
CObject1 *obj1; // defined inCObject1.h
CObject2 *obj2; // defined in CObject2.h
Cobject3 *obj3; // defined in CObject3.h
}
I'm on a HP-UX, and in one of the cpp files the Singleton object is
created(CSingleton.h). If one of the objects viz., CObject ; CObject2
;
CObject3 changes (ie., a change in the header)will i have to recompile
the cpp file.?? As of now, I recompile the cpp before execution.
Incase if I choose not to recompile the cpp file, will it cause any
future errors which might go undetected during compilation??

Regards
Anand

Victor Bazarov 07-08-2003 01:08 PM

Re: compilation dependencies ..
 
"Anand" <anandnewsgroup@yahoo.co.uk> wrote...
> I've a singleton object declaration


....you mean "definition"...

> in C++ in which there are other
> classes' POINTERS declared as private members as shown below.
>
> // CSingleton.h
>
> Class Singleton
> {
>
> private:
> CObject1 *obj1; // defined inCObject1.h
> CObject2 *obj2; // defined in CObject2.h
> Cobject3 *obj3; // defined in CObject3.h
> }

;

> I'm on a HP-UX, and in one of the cpp files the Singleton object is
> created(CSingleton.h).


One of the cpp files is an .h file? I am not sure I understand.

> If one of the objects viz., CObject ; CObject2
> ;
> CObject3 changes (ie., a change in the header)will i have to recompile
> the cpp file.??


It depends on whether you use the CObject3 class in it or not.
Usually, if 'obj3' is obtained from 'new' (that is, CObject3
is instantiated), you will need to recompile. If you obtain
your 'obj3' pointer from other function, there may not be a need
to recompile.

> As of now, I recompile the cpp before execution.


That's a safe approach.

> Incase if I choose not to recompile the cpp file, will it cause any
> future errors which might go undetected during compilation??


It is impossible to tell. My crystal ball is not working today.

Victor




All times are GMT. The time now is 04:56 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.