Type-safe homogeneous linkage for heterogeneous smart pointers
First Claim
1. A computer-implemented method for performing memory management of an object in an object-oriented programming environment using smart pointers, comprising the steps of:
- providing a base class common to all types of smart pointers;
providing at least one smart pointer comprising an object pointer for pointing to an object, the smart pointer having a next link for pointing to a subsequent smart pointer on a ring and a previous link for pointing to a previous smart pointer on the ring; and
providing a function for automatically converting a smart pointer to an object of a first class to a smart pointer to an object of a second class, wherein the first class and the second class share the common base class.
2 Assignments
0 Petitions
Accused Products
Abstract
A non-intrusive smart pointer for providing memory management and type-safe homogeneous linkage for heterogeneous smart pointers is provided. A linked list of smart pointers is provided to represent a reference count of an object pointed to by the smart pointers. A base common to all smart pointers is provided to permit pointers to different sub-objects of the same object to be members of a single ring. A class template for generating a different class of smart pointer for each class of object for which a smart pointer is used is provided. The class template provides member functions to generate smart pointer classes specific to the respective classes of objects controlled by the smart pointers to maintain type safety. In addition, member function templates of the class function are provided, to enable automatic conversion between smart pointers of different classes within the same class hierarchy.
59 Citations
34 Claims
-
1. A computer-implemented method for performing memory management of an object in an object-oriented programming environment using smart pointers, comprising the steps of:
-
providing a base class common to all types of smart pointers;
providing at least one smart pointer comprising an object pointer for pointing to an object, the smart pointer having a next link for pointing to a subsequent smart pointer on a ring and a previous link for pointing to a previous smart pointer on the ring; and
providing a function for automatically converting a smart pointer to an object of a first class to a smart pointer to an object of a second class, wherein the first class and the second class share the common base class. - View Dependent Claims (2)
-
-
3. A computer-implemented method of memory management, comprising the steps of:
-
providing a smart pointer for association with a memory-resident element, the smart pointer including a next pointer;
providing an assignment means for assigning the next pointer to point to the smart pointer thereby creating a linked list comprising the smart pointer; and
providing a comparison means for comparing the value of the next pointer to the value of the memory location of the smart pointer in which the selected next pointer is included, whereby a determination can be made if the ring contains more than one smart pointer. - View Dependent Claims (4, 5, 6, 7, 8, 9, 10, 11, 12, 14, 15, 16, 17, 18, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34)
-
-
13. A computer-implemented method of memory management, comprising the steps of:
-
providing a linked list comprising a smart pointer associated with a memory-resident element, the smart pointer including a next-pointer for pointing to the smart pointer; and
providing a comparison means for comparing the value of the memory location of the smart pointer to the value of the next-pointer of the smart pointer, to provide a determination whether the linked list contains only the smart pointer.
-
-
23. A computer-implemented method of memory management, comprising the steps of:
-
providing a linked list comprising a first smart pointer and a second smart pointer each associated with a memory-resident element, the first smart pointer including a first next-pointer for pointing to the second smart pointer and the second smart pointer including a second next-pointer for pointing to the first smart pointer; and
providing a comparison means for comparing the value of the memory location of a selected smart pointer giving up its association with the memory-resident element to the value of the next-pointer of the selected smart pointer, to provide a determination whether the linked list contains only the selected smart pointer.
-
Specification