“I bought this guide a few days ago to prepare for my interview with Oracle. Many of the questions they asked me were from this guide. I found this book absolutely great!”
According to the two phase constructor idiom all initialisation code that might leave , as well as any call to the fuction that might leave are put together into a constructor call ie; ConstructL() known as the two phase constructor. This is used for proper cleanup if any leave occurs.
Symbian OS is designed keeping in mind the scarce memory available. So memory is very costly for any symbian application. To help prevent any memory loss, two phase constructors are used. It says that “No initialization or function call that can leave be done in the first phase of constructor till the object to be created is pushed onto the cleanup stack”, only after this has been done can any leaving stuff be handled, so that in case if a leave does occur, the cleanup stack unwinds and clears all the data, and save our precious memory.
One of the common causes of leaving is running out of memory, Symbian OS utilizes a pattern for construction of complex objects referred to as two-phase construction. In the first phase, an object is allocated on the heap, but the constructor must not leave itself and must not call any leaving functions. Once the object has been constructed, it can be pushed on to the cleanup stack and a second-phase constructor, normally called ConstructL(), can be called to set up the rest of the data. Often this behavior is wrapped up in a static method that will allocate and construct an object.
Descriptors:
Why descriptor is called as descriptor..
Ans:As the descriptor are self describing itself,becouse it contets the length as well as type of descriptor..
type example are like TDesC,TBuf,TPtr etc..
According to the two phase constructor idiom all initialisation code that might leave , as well as any call to the fuction that might leave are put together into a constructor call ie; ConstructL() known as the two phase constructor. This is used for proper cleanup if any leave occurs.
Symbian OS is designed keeping in mind the scarce memory available. So memory is very costly for any symbian application. To help prevent any memory loss, two phase constructors are used. It says that “No initialization or function call that can leave be done in the first phase of constructor till the object to be created is pushed onto the cleanup stack”, only after this has been done can any leaving stuff be handled, so that in case if a leave does occur, the cleanup stack unwinds and clears all the data, and save our precious memory.
One of the common causes of leaving is running out of memory, Symbian OS utilizes a pattern for construction of complex objects referred to as two-phase construction. In the first phase, an object is allocated on the heap, but the constructor must not leave itself and must not call any leaving functions. Once the object has been constructed, it can be pushed on to the cleanup stack and a second-phase constructor, normally called ConstructL(), can be called to set up the rest of the data. Often this behavior is wrapped up in a static method that will allocate and construct an object.
Descriptors:
Why descriptor is called as descriptor..
Ans:As the descriptor are self describing itself,becouse it contets the length as well as type of descriptor..
type example are like TDesC,TBuf,TPtr etc..
Leave an Answer/Comment