copy_constructor

LInk a P2Resource object to a P2Project and P2Schedule object and copy all the resource data.

This function is somewhat different than the P2Project:copy_constructor and P2Schedule:copy_constructor functions, although the principle is the same: it copies all resource data to a new resource object. This function should be called in conjunction with P2Project:copy_constructor and P2Schedule:copy_constructor that temporarily contains all resource data that will now be linked to the P2Resource object using the P2Resource:copy_constructor function. The difference with the P2Resource:new function is that the copy_constructor function does not initialize the memory but instead copies the resource information.

Below you find the approach to copy all project, schedule and resource data into new objects.

Step 1. Create new objects:

Step 2. Copy the information from the old objects to the new objects using the constructor functions. The copy constructors should be called in the correct sequence, i.e. first the P2Project function, then the P2Schedule function and finally the P2Resource function.

Parameters: 
I/O Type Name Description
input project project a P2Project object
input schedule baseline a P2Schedule object
Example: 
function ()
        io.write('\n')
end
Class: 
P2Resource