refcnt.hh (3877:2432a50b7d25) | refcnt.hh (7057:ca72ee5978ce) |
---|---|
1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 23 unchanged lines hidden (view full) --- 32#define __BASE_REFCNT_HH__ 33 34class RefCounted 35{ 36 private: 37 int count; 38 39 private: | 1/* 2 * Copyright (c) 2002-2005 The Regents of The University of Michigan 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are 7 * met: redistributions of source code must retain the above copyright 8 * notice, this list of conditions and the following disclaimer; --- 23 unchanged lines hidden (view full) --- 32#define __BASE_REFCNT_HH__ 33 34class RefCounted 35{ 36 private: 37 int count; 38 39 private: |
40 // Don't allow a default copy constructor or copy operator on 41 // these objects because the default operation will copy the 42 // reference count as well and we certainly don't want that. |
|
40 RefCounted(const RefCounted &); | 43 RefCounted(const RefCounted &); |
44 RefCounted &operator=(const RefCounted &); |
|
41 42 public: 43 RefCounted() : count(0) {} 44 virtual ~RefCounted() {} 45 46 void incref() { ++count; } 47 void decref() { if (--count <= 0) delete this; } 48}; --- 75 unchanged lines hidden --- | 45 46 public: 47 RefCounted() : count(0) {} 48 virtual ~RefCounted() {} 49 50 void incref() { ++count; } 51 void decref() { if (--count <= 0) delete this; } 52}; --- 75 unchanged lines hidden --- |