-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update Input-File.md to describe the Factory Function method of alloc… #1763
Conversation
…ating objects from the input file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placement new explanation and example are very helpful. Thanks!
|
||
The first method is to call the `Trick::MemoryManager` routines to allocate memory. This is the preferred method. | ||
### 1. Call `Trick::MemoryManager` allocation routines directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about changing it to "Call Trick::MemoryManger Allocation Routines Directly" -- no period and capitalize the first letter of each word to be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
|
||
This creates and initializes seven *Ball* objects needed to configure a Newton's cradle. | ||
|
||
### 3. Call the Wrapped Class Constructor Directly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either remove the period or add for all other bullets
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hong demands absolute clarity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
``` | ||
|
||
Because this function is bound to Python by SWIG, it can be called from the input file. | ||
For examaple, : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keep either ,
or :
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also corrected spelling : examaple --> example
@@ -188,7 +190,80 @@ food[2] = trick.alloc_type(6, "double") | |||
|
|||
Memory allocated using the above routines are tracked by the memory manager and is checkpointable and data recordable. | |||
|
|||
The second method is to call the wrapped constructor of the class directly. This is analogous to declaring local | |||
### 2. Use a Factory Function | |||
This benefit of this method is flexibility in how objects are initialized. For example, we might want to initialize our objects with a non-default constructor. So, the requirements for our factory function are: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This benefit --> The benefit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
…ating objects from the input file.