|
| |
| | Pointer - definition of Pointer in Encyclopedia |
 | | This use of null pointers can be compared to the use of null values in relational databases. |  | | In computer science, a pointer is a programming language datatype whose value is used to refer to ("points to") another value stored elsewhere in the computer memory. |  | | Pointer arithmetic is unrestricted; adding or subtracting from a pointer moves it by that number of bytes in either direction, but using the Inc or Dec standard procedures on it moves it by the size of the datatype it is declared to point to. |
|
http://encyclopedia.laborlawtalk.com/Pointer
(1567 words)
|
|
| |
| | Dev Source: Smart Pointers in C++ |
 | | In brief, smart pointers are C++ objects that simulate simple pointers by implementing operator-> and the unary operator*. |  | | In some cases, a smart pointer might aggregate some handles to data and compute the pointer on the fly. |  | | In addition to sporting pointer syntax and semantics, smart pointers often perform useful tasks—such as memory management or locking—under the covers, thus freeing the application from carefully managing the lifetime of pointed-to objects. |
|
http://www.findarticles.com/p/articles/mi_zddvs/is_200407/ai_ziff130811
(1276 words)
|
|
| |
| | Phrog Tutorial - Smart Pointers |
 | | With smart pointers, we can't use a typecasting, because we don't have a reference to the object. |  | | When a method returns an object and you don't know if it is safe to change this object, one way to check is to check there reference counter on the smart pointer, if the value is one, then that is the only reference to the object, so it must be OK to change it. |  | | For every class that can be smart pointed, there is a class file (suffix "_cl"), which contains the code for the class itself, and a smart pointer class (suffix "_sptr"). |
|
http://ai.stanford.edu/~frog/tutorial-session1a.html
(413 words)
|
|
| |
| | Reference (computer science) - Encyclopedia.WorldSearch |
 | | Pointer Fun With Binky Introduction to pointers in a 3 minute educational video - Stanford Computer Science Education Library |  | | When we need to be precise, we define references in terms of a dereferencing function d, where d is a partial function from an uninterpreted set L of locations to a set of values. |  | | For example, the call by reference calling convention can be implemented with either explicit or implicit use of references. |
|
http://encyclopedia.worldsearch.com/reference_(computer_science).htm
(721 words)
|
|
| |
| | Smart Pointer |
 | | Smart pointers should also implement the * operator to return a reference to the pointee, in the same manner as built in pointers. |  | | Although smart pointers themselves can be somewhat complex to design and implement, using them is usually very easy, and in fact simplifies a lot of code. |  | | BTW, the phrase you quoted was almost certainly intended to apply to unconventional implementations of operator*, rather than to smart pointers in general. |
|
http://c2.com/cgi/wiki?SmartPointer
(643 words)
|
|
| |
| | [No title] |
 | | It asserts that implied instance smart pointer is not NULL and then returns the pointer data member (to have the -> operator applied to it). |  | | Return Value: (object *) - pointer to the object to which the smart pointer points. |  | | Error Handling: If the smart pointer is NULL, an assert is activated. |
|
http://www.cs.caltech.edu/~yrliu/cs47/hw6/arrayptr.h
(477 words)
|
|
| |
| | Siefast: Reference Counting |
 | | The smart pointer class used in the simulator is based on the handle class sketched in Stroustrup's book. |  | | Reference count may be called smart memory, smart pointers, handle classes, envelope classes, or referencing counting. |  | | For example, ProcessPtr is a reference counted pointer to the Process class. |
|
http://www.cse.ohio-state.edu/siefast/simulator/dev-docs/reference-counting.htm
(534 words)
|
|
| |
| | Software Design (C++): Sample of C++ Idioms |
 | | Note that smart pointers provide an alternative memory management solution which may be more modular, and can also be used with existing classes that cannot be modified. |  | | The smart pointer class is made more modular (non-intrusive) by storing the count as an independent value. |  | | In C++, for example, a deleted object may be accidentally accessed through a dangling pointer, or a program may fail to release all its garbage. |
|
http://www.cs.helsinki.fi/u/vihavain/s01/cpp/idioms.html
(2783 words)
|
|
| |
| | Reference Counted Smart Pointers |
 | | On the other hand, if the reference count is kept in the object being managed, usually by deriving its class from a mixin base class, the smart pointers are smaller and quicker to create, and you avoid the overhead of the allocation and deletion of the reference count. |  | | It is important to understand that each reference counted smart pointer shares ownership of the underlying object equally. |  | | You might attempt to subclass an STL container and free the pointers in your subclass' destructor but this is incorrect also, because STL containers do not have virtual destructors. |
|
http://www.goingware.com/tips/parameters/refcount.html
(1762 words)
|
|
| |
| | C++ Smart Pointers |
 | | These Smart Pointers either "point" to an object or they equal NULL (they never point to memory that has been deleted and they are always initialized). |  | | If you pass an actual Active Pointer into a function, by reference, then you'll be ok. If you have a reference to an Active Pointer, which you received from another thread, and you pass that reference into a function, then your code would not be considered thread safe. |  | | This approach only works for user defined types, and the Smart Pointers would never be able to point to built-in types (like int and float). |
|
http://smart-pointers.sourceforge.net
(2360 words)
|
|
| |
| | tbox_ConstPointer |
 | | The pointer returned is a const pointer to the object. |  | | The non-const and const pointer classes have been designed so that an attempted conversion from a const pointer into a non-const pointer causes a compile-time error. |  | | It manages all reference counting and deallocation of the pointer (even if the data was originally allocated from a memory arena). |
|
http://www.c3.lanl.gov/~pernice/samrai/docs/manual/html/tbox_ConstPointer.html
(508 words)
|
|
| |
| | DjVu Reference Library |
 | | The cached pointer will remain valid until the smart-pointer object is destroyed or the smart-pointer value is changed. |  | | This is useful for caching the value of a smart-pointer for performances purposes. |  | | This is not enough to catch the error at compile time, but this is a simple way to document such a behavior. |
|
http://www.djvuzone.org/open/doc/GP.html
(778 words)
|
|
| |
| | ZeroC Forums - About the smart pointer. |
 | | You have to set all smart pointers that still point to the object to null. |  | | With the code above you create a copy of a reference counted smart pointer, and then set this copy to null. |  | | That's how counted smart pointers work, i.e., the pointed-to object gets deleted when the reference count becomes zero. |
|
http://www.zeroc.com/vbulletin/printthread.php?t=706
(348 words)
|
|
| |
| | Smart Pointer Package |
 | | An abstraction that simplifies the use of pointers referring to objects on the heap. |  | | The Smart Pointer package includes a generic singleton template class, a simple pointer wrapper, and two varieties of thread-safe reference-counted pointers. |  | | Defines a reference-counted pointer that provides reference counting semantics for objects that do not directly support reference counting. |
|
http://www.roguewave.com/support/docs/sourcepro/threadsref/2-6.html
(324 words)
|
|
| |
| | Smart pointer templates in C++ |
 | | The ObjVar's pointer to the counted instance is set to zero to indicate that the current variable now references the Nul object. |  | | However, because the only data held in one of our object variable instances is a single pointer to a reference-counted object, passing and returning object variable instances is efficient. |  | | Instances of this class act like object variables in Smalltalk and similar languages, in which a variable is effectively always a reference of some sort (in C++ terms, a reference or pointer), and never a 'whole' object on the stack or in static storage. |
|
http://www.davethehat.com/articles/smartp.htm
(3662 words)
|
|
| |
| | class PSmartPointer |
 | | This is the class for pointers to objects that use the |  | | may be returned depending on the relative values of the memory pointers. |  | | class, this class references objects that can have the automatic deletion of the object instance when there are no more smart pointer instances pointing to it. |
|
http://www.openh323.org/docs/pwlib/PSmartPointer.html
(279 words)
|
|
| |
| | shared_ptr |
 | | For example, a "no-op" deallocator is useful when returning a shared_ptr to a statically allocated object, and other variations allow a shared_ptr to be used as a wrapper for another smart pointer, easing interoperability. |  | | Since the deallocator is not part of the type, changing the allocation strategy does not break source or binary compatibility, and does not require a client recompilation. |  | | One common usage of shared_ptr is to implement a handle/body (also called pimpl) idiom which avoids exposing the body (implementation) in the header file. |
|
http://www.boost.org/libs/smart_ptr/shared_ptr.htm
(2607 words)
|
|
| |
| | ANSI Degree College Mardan :: Digital Library - Smart Pointers |
 | | One good example of such an operation involves making sure pointers are initialized correctly so that embarrassing calls through randomly assigned pointers don't happen. |  | | You can also use templates to provide client code with an easy way to specialize the behavior of a class by passing in algorithms as template parameters. |  | | In addition to wrapping a pointer, the CSmartMusician class implements several operators. |
|
http://www.ansi.edu.pk/library/WSLP/book1/html/ch03d.htm
(800 words)
|
|
| |
| | Smart Pointers - What, Why, Which? |
 | | Although it is possible to implement optimized allocation schemes using class-specific new and delete operators, smart pointers give you the freedom to choose whether to use the optimized scheme for each object, instead of having the scheme set for all objects of a class. |  | | It is therefore possible to match the allocation scheme to different operating environments and applications, without modifying the code for the entire class. |  | | When some part of the program tries to modify the object ("write"), the COW pointer creates a new copy of the object and modifies this copy instead of the original object. |
|
http://ootips.org/yonat/4dev/smart-pointers.html
(1914 words)
|
|
| |
| | Page 2 - SatView: Pointer Perfect, part 3.5 |
 | | Shared pointers can be pretty useful as members of a class, for example when you are making use of the pimpl idiom. |  | | Your concept of ownership might lure you into the intuitive view of regarding a smart pointer to be reference counted. |  | | The use_count() function is useful when debugging a boost::shared_ptr, because it returns the reference count of the smart pointer (2 in this example). |
|
http://www.aspfree.com/c/a/C-Sharp/SatView-Pointer-Perfect-part-3-5/1
(922 words)
|
|
| |
| | flipcode - COM Smart Pointer |
 | | The zip file viewer built into the Developer Toolbox makes use of the zlib library, as well as the zlibdll source additions. |  | | May never be a problem, but better be on the safe side. |  | | In this way, it is completely transparent to use. |
|
http://www.flipcode.com/cgi-bin/fcarticles.cgi?show=64149
(1027 words)
|
|
| |
| | NodeWorks - Encyclopedia: Smart pointer |
 | | Pointer usage is a major source of bugs: the constant allocation, deallocation and referencing that must be performed by a program written using pointers makes it very likely that some memory leaks will occur. |  | | Unix file descriptors may also be thought of as an early example of a handle. |  | | For example, a window on the desktop is represented as a handle called |
|
http://pedia.nodeworks.com/S/SM/SMA/Smart_pointer
(365 words)
|
|
| |
| | GotW #62: Smart Pointer Members |
 | | Note that it's important to check whether other's pointer is null or not. |  | | It may seem at first like that such facilities would be a good idea because they contribute to HolderPtr's intended purpose and usage as a class member; consider, for example, Example 4 in the solution to GotW #59, where the class member holds a Pimpl pointer and it's desirable to write an exception-safe assignment operator... |  | | In other code, we normally apply the good practice of wrapping bald pointers in manager objects that own them and simplify cleanup. |
|
http://www.gotw.ca/gotw/062.htm
(3525 words)
|
|
| |
| | dBforums - What's a smart pointer? |
 | | It is a simple wrapper around a regular pointer. |  | | out how many has pointers to the data and only releases when the reference |  | | > It is a simple wrapper around a regular pointer. |
|
http://www.dbforums.com/t1025949.html
(606 words)
|
|
| |
| | CintTalk: [CINT] Re: smart pointer in CINT |
 | | Next in thread: Masaharu Goto: "[CINT] Re: smart pointer in CINT" |  | | Maybe reply: Masaharu Goto: "[CINT] Re: smart pointer in CINT" |
|
http://root.cern.ch/root/cinttalk/cint03/0214.html
(238 words)
|
|
| |
| | smart_pointer.hh Source File |
 | | 00209 // 00210 register pointer ptItem; 00211 register TDerivedItem* ptDerivedItem (NULL); 00212 00213 // 00214 // Checks for possible syntax errors about using classes with no relation with 00215 // this instance to assign to this instance. |  | | ptSharedCell->luiReferenceCount) 00278 { 00279 // 00280 // Warning: There is no check when deleting ptSharedCell->pvItem (for 00281 // NULL value) cause there is no way to assign a NULL pointer 00282 // value. |  | | ptSharedCell) 00407 { 00408 throw TConstraintException ("null pointer", __FILE__, __LINE__); 00409 } 00410 return *((pointer) ptSharedCell->pvItem); 00411 } 00412 00413 }; // class TSmartPointer 00414 00415 } // namespace memory 00416 00417 } // namespace mpcl 00418 00419 00420 #endif // not _MPCL_MEMORY_SMART_POINTER__ |
|
http://www.uesqlc.org/doc/mpcl/smart__pointer_8hh-source
(327 words)
|
|
| |
| | Smart Pointer C++ Interface Primer |
 | | Other classes do not have a direct interface, but may be passed to the constructor of a base class smart pointer. |  | | The interface also lets you deal with NAO objects as real objects instead of pointers. |  | | The Smart Pointer C++ Interface presents the NAO class library as a C++ class library. |
|
http://www.research.ibm.com/nao/Primer/smartPtrInterfacePrimer.html
(430 words)
|
|
| |
| | Smart Pointer Thread Safety |
 | | * In garbage collected languages a weak pointer is often used to differentiate between external and internal ownership. |  | | That means that you must implement your own protocol for using this object. |  | | With reference counted pointers the same effect is achieved using a level of indirection. |
|
http://jelovic.com/articles/smart_pointer_thread_safety.htm
(438 words)
|
|
| |
| | Page 3 - Satview: Pointer Perfect, Part 3 |
 | | The concept of a smart pointer is essentially simple, though the many different ways we can implement this concept provides different behaviours and leaves us with much to investigate. |  | | Our resource is automatically released and there is no need for the complex try/catch (or even worse goto) structure to make sure we are not leaking. |  | | This means that you can use the reference and pointer-to-member operators, but you are prohibited from using the dereference and arithmetic operators. |
|
http://www.aspfree.com/c/a/C-Sharp/Satview-Pointer-Perfect-Part-3/2
(656 words)
|
|
| |
| | Astrology Software - Parashara's Light - Product Reviews |
 | | When you move the pointer to the symbol for moving the dasha date backwards in time, it displays the word "earlier", while if you move it to the symbol for decreasing the number of dashas shown, it shows the word "fewer". |  | | The worksheet is one of the most outstanding and effective tools I've ever seen in an astrology program. |  | | The worksheet uses a smart pointer to help you. |
|
http://www.astrologysoftwareshop.com/charting/pl/reviews.htm
(2784 words)
|
|
| |
| | dBforums - Smart Pointer Implementation |
 | | good/acceptable/slightly dubious/mediocre way to implement a smart pointer |  | | I'm no expert so I'll just refer you to an excellent smarter pointer library |  | | - the destructor for this pointer (to the memory |
|
http://dbforums.com/t560076.html
(1365 words)
|
|
| |
| | Templatesmart_pointer class Reference |
 | | Here is a convenient way to implement a true copy semantc, by using shallow copies and reference counting, in order to minimise memory copies. |  | | The true semantic copy is defined as follows: if an object |  | | This concept is generally related to the smart pointer method for managing memory. |
|
http://www-lmc.imag.fr/lmc-edp/Pierre.Saramito/rheolef/source/classsmart__pointer.html
(101 words)
|
|
| |
| | Question about smart pointer |
 | | By the end of function foo(), the memory that is allocated to p will |  | | But that allocated memory will still be deallocated by the end of foo(), right? |  | | Ownership is transferred to the copy of the pointer returned by |
|
http://www.groupsrv.com/computers/about26595.html
(879 words)
|
|
| |
| | Puzzle on smart pointer - ZeroC Forums |
 | | Another way is to store the UUID of object in the tree node by store a pointer to a std::string, but the shortcoming is each time I use the object, it should begin with locator from the very beginning, seem not a good idea. |  | | I'm not an MFC programmer but, from looking at the MSDN documentation for CTreeCtrl, I would create a table that holds your proxies (so the proxies that are pointed at by the tree items won't go out of scope). |  | | Another question is if I use evictor on the server side, and for a long time, the object may be evicted on the server, but if I try to use the Pxy made early, does there be some problem? |
|
http://www.zeroc.com/vbulletin/showthread.php?t=660
(203 words)
|
|
| |
| | Introducing the Smart Pointer Package |
 | | A simple pointer wrapper for local protection of heap allocations from memory leaks in the face of exceptions |  | | Smart pointers by themselves are useful for both exception-safe programming and automated garbage collection. |  | | The Smart Pointer package depends on the Thread-compatible Exception, Execution Tracing, and Synchronization packages of the Threads Module. |
|
http://www.roguewave.com/support/docs/leif/sourcepro/html/threadsug/7-1.html
(244 words)
|
|
| |
| | Garbage Collected Smart Pointer Advantages |
 | | The collector always deletes unreferenced objects before referenced ones, in the same way a reference-counting smart pointer would. |  | | Many smart pointers (including Boost's) cannot point to automatic variables or members of objects, since they will ultimately delete them. |  | | gc::ptr isn't smart enough to get all possible cycles, but it can get some of them, which is more than a straight referenced counted smart pointer could do. |
|
http://www.vzavenue.net/~danieljohnson/cpp/gcptr_advantages.html
(285 words)
|
|
| |
| | C++ - Smart pointer template question |
 | | In this way I can put any Object in a Tuple and polymorphically elbow |  | | Most of the times a smart pointer to Object is all that |
|
http://www.codecomments.com/archive272-2004-11-319109.html
(730 words)
|
|
| |
| | C++ Programming: Smart Pointer = Operator Exception Occurred |
 | | I was wondering if anyone could suggest specific scenarios that would account for the error I am seeing. |  | | Basically, the error "Exception Occurred" (0x80020009) is getting thrown when I do a COM smart pointer assignment. |  | | AFAIK, the only thing that happens during the assignment is AddRef() gets called on the object, so it is hard to see how that could go wrong, but if anyone has any ideas, I would be most appreciative. |
|
http://www.experts-exchange.com/Programming/Programming_Languages/Cplusplus/Q_20977526.html
(352 words)
|
|
| |
| | Yonat's Stuff for Developers |
 | | linked_ptr.h - simple reference linked pointer (like reference counting, just using a linked list of the references, instead of their count.) |  | | Many times this is a better alternative than using smart pointers (no overhead, no multi-threading problems). |  | | For an introduction to smart pointers and an explanation of their use, see my article Smart Pointers - What, Why, Which? |
|
http://ootips.org/yonat/4dev
(157 words)
|
|
| |
| | FipS' HOLE - Dumped links - The links I've recently visited! |
 | | How to use STL helper template function mem_fun in sophisticated algorithms |  | | Dynamic C++ Classes - A lightweight mechanism to update code in a running program |  | | Member Function Pointers and the Fastest Possible C++ Delegates |
|
http://www.fs-games.com/FipS/lnk_dumped.php
(180 words)
|
|
| |
| | Which is preferable std::auto_ptr or boost's smart pointer? |
 | | Proposals based on boost::shared_ptr and boost::weak_ptr have been |  | | context on what the smart pointer is supposed to do. |  | | Containers library, by Thorsten Ottosen, and may therefore soon become an |
|
http://www.groupsrv.com/computers/about80095.html
(726 words)
|
|
| |
| | .NET Languages / VC - Need a cloning smart pointer |
 | | Is there a smart pointer out there doing |  | | > Is there a smart pointer out there doing |  | | Home > Archive >.NET Languages / VC > February 2004 > Need a cloning smart pointer |
|
http://www.mcse.ms/archive108-2004-2-383585.html
(317 words)
|
|
|