23#define USE_DOUBLE_PTR_IN_PASSIVEPTR
33#define USE_DELETE_AT_ZERO_COUNT
60#define COPY_TYPE_CHECK
67#define USE_GETSETTERS_IN_PASSIVEPTR
76#define USE_PRIVATE_PARAM_IN_PASSIVEPTR
80#if defined(USE_PRIVATE_PARAM_IN_PASSIVEPTR) && \
81 !defined(USE_GETSETTERS_IN_PASSIVEPTR)
82"options incompatible\n";
85#define USE_CHAR_CONTROL_VARIABLES
108#if defined(USE_CHAR_CONTROL_VARIABLES) && defined(USE_BIT_FIELDS)
109"options incompatible\n";
111#if defined(USE_CHAR_CONTROL_VARIABLES) && defined(USE_BIT_OPERA)
112"options incompatible\n";
114#if defined(USE_BIT_FIELDS) && defined(USE_BIT_OPERA)
115"options incompatible\n";
118#define USE_CHAR_GETSETTERS_PARAMETERS
125#if defined(USE_CHAR_CONTROL_VARIABLES) && \
126 !defined(USE_CHAR_GETSETTERS_PARAMETERS)
127"options incompatible\n";
136#ifdef DEBUG_ACTIVEPTR
137 mcout <<
"static X* StandardCopyDefinition::copy(const X* f)\n";
141#ifndef COPY_TYPE_CHECK
145#ifdef DEBUG_ACTIVEPTR
146 mcout <<
"X* StandardCopyDefinition::copy(const X* f): f->copy() returned "
148 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
150 mcerr <<
"Type of *p is (in internal notations) " <<
typeid(*p).name()
153 if (
typeid(*p) !=
typeid(*f)) {
154 mcerr <<
"Error in X* StandardCopyDefinition::copy(const X* f): "
155 <<
"typeid(*p) != typeid(*f) \n";
156 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
158 mcerr <<
"Type of *p is (in internal notations) " <<
typeid(*p).name()
160 mcerr <<
"Type of *f is (in internal notations) " <<
typeid(*f).name()
162 mcerr <<
"Possible reason is omiting of copy function in one of the "
163 "derivative classes\n";
198template <
class X,
class C = StandardCopyDefinition<X> >
210#ifdef IMPLICIT_X_STAR
211 inline operator X*(void)
const;
215 inline X*
get(
void)
const {
return ptr; }
225 inline void put(
const X* fptr) {
228#ifdef DEBUG_ACTIVEPTR
229 mcout <<
"inline void put(const X* fptr)\n";
231 mcout <<
"Type of X is (in internal notations) " <<
typeid(X).name()
233 mcout <<
"Type of *fptr is (in internal notations) " <<
typeid(*fptr).name()
239 X* ptr_temp = (fptr != NULL ? C::copy(fptr) : (X*)(NULL));
242#ifdef DEBUG_ACTIVEPTR
243 mcout <<
"finishing inline void put(const X* fptr):\n";
260 mcerr <<
"ERROR in ActivePtr::pass(X* fptr):\n";
261 mcerr <<
"Both the destination and source pointers are not empty\n";
282#ifdef DEBUG_ACTIVEPTR
283 mcout <<
"ActivePtr::clear is called, ptr =" << ptr <<
'\n';
293#ifdef DEBUG_ACTIVEPTR
294 mcout <<
"ActivePtr::pilfer is called\n";
299 mcerr <<
"ERROR in ActivePtr::pilfer(...):\n";
300 mcerr <<
"Both the destination and source pointers are not empty\n";
316 void print(std::ostream& file,
int l = 1)
const;
320 : ptr(fptr != NULL ? C::
copy(fptr) : ((X*)NULL))
321#ifndef DEBUG_ACTIVEPTR
326 mcout <<
"ActivePtr(const X* fptr, Clone) is finished, ptr =" << ptr
329 cout <<
"deleted, exit\n";
335 : ptr(f.ptr != NULL ? C::
copy(f.ptr) : f.ptr)
336#ifndef DEBUG_ACTIVEPTR
341 mcout <<
"ActivePtr(const ActivePtr<X,C>& f) is finished\n";
348#ifdef DEBUG_ACTIVEPTR
349 mcout <<
"ActivePtr(const ActivePtr<X,C>& f, Pilfer) is run\n";
358#ifdef DEBUG_ACTIVEPTR
359 mcout <<
"inline ActivePtr& operator=(const ActivePtr<X,C>& f)\n";
361 if (
this != &f)
put(f.ptr);
390template <
class X,
class C>
392 Ifile <<
"ActivePtr<X,C>: ";
394 file <<
" ptr==NULL. \n";
396 file <<
" ptr!=NULL: ";
403template <
class X,
class C>
405 Ifile <<
"ActivePtr<X,C>: ";
407 file <<
" ptr==NULL. \n";
409 file <<
" ptr!=NULL: ";
418template <
class X,
class C>
423 for (n = 0; n < q - 1; n++) {
424 keyline[n] = file.get();
427 if (!strcmp(&(keyline[0]),
" ptr==NULL. ")) {
437template <
class X,
class C>
439#ifdef SKIP_CHECKS_NULL
443 mcerr <<
"Error in X* ActivePtr<X,C>::operator->(void) const: "
445 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name() <<
'\n';
451template <
class X,
class C>
453#ifdef SKIP_CHECKS_NULL
456 if (ptr)
return *ptr;
457 mcerr <<
"Error in X& ActivePtr<X,C>::operator*(void) const: "
459 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name() <<
'\n';
464template <
class X,
class C>
466#ifdef SKIP_CHECKS_NULL
470 mcerr <<
"Error in X* ActivePtr<X,C>::getver(void) const: "
472 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name() <<
'\n';
477#ifdef IMPLICIT_X_STAR
478template <
class X,
class C>
480#ifdef SKIP_CHECKS_NULL
484 mcerr <<
"Error in ActivePtr<X,C>::operator X*(void) const: "
486 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name() <<
'\n';
492template <
class X,
class C>
504namespace CountPP_ns {
512 inline void book(
void);
523 long number_of_booked;
527 if (number_of_booked > LONG_MAX - 1) {
528 mcerr <<
"Error in CountPassivePtr::book(void):\n"
529 <<
" too much booked counters, number_of_booked > LONG_MAX-1, "
530 "number_of_booked=" << number_of_booked <<
'\n';
537 if (number_of_booked < 1) {
538 mcerr <<
"Error in CountPassivePtr::unbook(void):\n"
539 <<
" number_of_booked < 1, number_of_booked=" << number_of_booked
549const unsigned char eb_s_ban_del = 1;
550const unsigned char eb_s_ban_sub1 = 2;
551const unsigned char eb_s_ban_sub2 = 4;
552const unsigned char eb_s_ban_cop1 = 8;
553const unsigned char eb_s_ban_cop2 = 16;
554#ifdef USE_DELETE_AT_ZERO_COUNT
555const unsigned char eb_s_allow_del_at_zero_count = 32;
567 inline static void clear_bit(
unsigned char& cw,
unsigned char b) {
572 inline static void rise_bit(
unsigned char& cw,
unsigned char b) { cw |= b; }
576#elif defined(USE_BIT_FIELDS)
579 unsigned int s_ban_del : 1;
580 unsigned int s_ban_sub : 2;
581 unsigned int s_ban_cop : 2;
582#ifdef USE_DELETE_AT_ZERO_COUNT
583 unsigned int s_allow_del_at_zero_count : 1;
591 s_allow_del_at_zero_count(0)
595#ifdef USE_CHAR_GETSETTERS_PARAMETERS
596 ControlParam(
char fs_ban_del,
char fs_ban_sub,
char fs_ban_cop = 0
599 char fs_allow_del_at_zero_count = 0
604 ControlParam(int fs_ban_del, int fs_ban_sub, int fs_ban_cop = 0
607 int fs_allow_del_at_zero_count = 0
612 s_ban_del(fs_ban_del),
613 s_ban_sub(fs_ban_sub),
614 s_ban_cop(fs_ban_cop)
617 s_allow_del_at_zero_count(fs_allow_del_at_zero_count)
620 if (!(fs_ban_del == 0 || fs_ban_del == 1)) {
621 mcerr <<
"ERROR in ControlParam::ControlParam(...)\n";
622 mcerr <<
"s_ban_del is outside limits, s_ban_del=" << fs_ban_del
626 if (fs_ban_sub < 0 || fs_ban_sub > 2) {
627 mcerr <<
"ERROR in ControlParam::ControlParam(...):\n";
628 mcerr <<
"s_ban_sub is outside limits, s_ban_sub=" << fs_ban_sub
632 if (fs_ban_cop < 0 || fs_ban_cop > 2) {
633 mcerr <<
"ERROR in ControlParam::ControlParam(...):\n";
634 mcerr <<
"s_ban_cop is outside limits, s_ban_cop=" << fs_ban_cop
638#ifdef USE_DELETE_AT_ZERO_COUNT
639 if (!(s_allow_del_at_zero_count == 0 || s_allow_del_at_zero_count == 1)) {
640 mcerr <<
"ERROR in ControlParam::ControlParam(...)\n";
641 mcerr <<
"s_allow_del_at_zero_count is outside limits, "
642 "s_allow_del_at_zero_count=" << fs_allow_del_at_zero_count
655#elif defined USE_BIT_FIELDS
662 s_allow_del_at_zero_count(0),
667#ifdef USE_CHAR_GETSETTERS_PARAMETERS
671 inline
RegPassivePtr(int fs_ban_del, int fs_ban_sub, int fs_ban_cop = 0)
676#elif defined(USE_BIT_FIELDS)
677 conparam(fs_ban_del, fs_ban_sub, fs_ban_cop),
679 s_ban_del(fs_ban_del), s_ban_sub(fs_ban_sub), s_ban_cop(fs_ban_cop),
681 s_allow_del_at_zero_count(0),
717 virtual void print(std::ostream& file,
int l = 1)
const;
731 unsigned char control_word;
734#ifdef USE_PRIVATE_PARAM_IN_PASSIVEPTR
737 static int s_ban_del_ignore;
738 static int s_print_adr_cpp;
739#ifdef USE_PRIVATE_PARAM_IN_PASSIVEPTR
743#elif defined(USE_BIT_FIELDS)
745 ControlParam conparam;
748#ifdef USE_PRIVATE_PARAM_IN_PASSIVEPTR
751 static int s_ban_del_ignore;
752 static int s_print_adr_cpp;
753#ifdef USE_PRIVATE_PARAM_IN_PASSIVEPTR
759#ifdef USE_PRIVATE_PARAM_IN_PASSIVEPTR
762#ifdef USE_CHAR_CONTROL_VARIABLES
774 static int s_ban_del_ignore;
781#ifdef USE_CHAR_CONTROL_VARIABLES
801#ifdef USE_CHAR_CONTROL_VARIABLES
813#ifdef USE_DELETE_AT_ZERO_COUNT
814#ifdef USE_CHAR_CONTROL_VARIABLES
815 char s_allow_del_at_zero_count;
817 int s_allow_del_at_zero_count;
827 static int s_print_adr_cpp;
835#ifdef USE_PRIVATE_PARAM_IN_PASSIVEPTR
841#ifdef USE_GETSETTERS_IN_PASSIVEPTR
843#ifdef USE_CHAR_GETSETTERS_PARAMETERS
851 clear_bit(control_word, eb_s_ban_del);
852 else if (fs_ban_del == 1)
853 rise_bit(control_word, eb_s_ban_del);
855 if (fs_ban_del == 0 || fs_ban_del == 1) {
857 conparam.s_ban_del = fs_ban_del;
859 s_ban_del = fs_ban_del;
864 mcerr <<
"ERROR in inline void set_s_ban_del(int fs_ban_del):\n";
865 mcerr <<
"s_ban_del is outside limits, s_ban_del=" << int(fs_ban_del)
871#ifdef USE_CHAR_GETSETTERS_PARAMETERS
878 if ((control_word & eb_s_ban_del) != 0)
883#elif defined(USE_BIT_FIELDS)
885 return conparam.s_ban_del;
888 {
return s_ban_del; }
891#ifdef USE_CHAR_GETSETTERS_PARAMETERS
897 if (fs_ban_del_ignore == 0 || fs_ban_del_ignore == 1) {
898 s_ban_del_ignore = fs_ban_del_ignore;
900 mcerr <<
"ERROR in inline void set_s_ban_del_ignore(int "
901 "fs_ban_del_ignore ):\n";
902 mcerr <<
"s_ban_del_ignore is outside limits, s_ban_del_ignore="
903 << int(fs_ban_del_ignore) <<
'\n';
908#ifdef USE_CHAR_GETSETTERS_PARAMETERS
914 return s_ban_del_ignore;
917#ifdef USE_CHAR_GETSETTERS_PARAMETERS
924 if (fs_ban_sub == 0) {
925 clear_bit(control_word, eb_s_ban_sub1);
926 clear_bit(control_word, eb_s_ban_sub2);
927 }
else if (fs_ban_sub == 1) {
928 rise_bit(control_word, eb_s_ban_sub1);
929 clear_bit(control_word, eb_s_ban_sub2);
930 }
else if (fs_ban_sub == 2) {
931 clear_bit(control_word, eb_s_ban_sub1);
932 rise_bit(control_word, eb_s_ban_sub2);
935 if (fs_ban_sub >= 0 && fs_ban_sub <= 2) {
937 conparam.s_ban_sub = fs_ban_sub;
939 s_ban_sub = fs_ban_sub;
944 mcerr <<
"ERROR in inline void set_s_ban_sub(int fs_ban_sub):\n";
945 mcerr <<
"s_ban_sub is outside limits, s_ban_sub=" << int(fs_ban_sub)
951#ifdef USE_CHAR_GETSETTERS_PARAMETERS
958 if ((control_word & eb_s_ban_sub2) == 0) {
959 if ((control_word & eb_s_ban_sub1) == 0)
969#elif defined(USE_BIT_FIELDS)
971 return conparam.s_ban_sub;
974 {
return s_ban_sub; }
977#ifdef USE_CHAR_GETSETTERS_PARAMETERS
984 if (fs_ban_cop == 0) {
985 clear_bit(control_word, eb_s_ban_cop1);
986 clear_bit(control_word, eb_s_ban_cop2);
987 }
else if (fs_ban_cop == 1) {
988 rise_bit(control_word, eb_s_ban_cop1);
989 clear_bit(control_word, eb_s_ban_cop2);
990 }
else if (fs_ban_cop == 2) {
991 clear_bit(control_word, eb_s_ban_cop1);
992 rise_bit(control_word, eb_s_ban_cop2);
995 if (fs_ban_cop >= 0 && fs_ban_cop <= 2) {
997 conparam.s_ban_cop = fs_ban_cop;
999 s_ban_cop = fs_ban_cop;
1004 mcerr <<
"ERROR in inline void set_s_ban_cop(int fs_ban_cop):\n";
1005 mcerr <<
"s_ban_cop is outside limits, s_ban_cop=" << int(fs_ban_cop)
1011#ifdef USE_CHAR_GETSETTERS_PARAMETERS
1018 if ((control_word & eb_s_ban_cop2) == 0) {
1019 if ((control_word & eb_s_ban_cop1) == 0)
1027#elif defined USE_BIT_FIELDS
1029 return conparam.s_ban_cop;
1032 {
return s_ban_cop; }
1035#ifdef USE_DELETE_AT_ZERO_COUNT
1037#ifdef USE_CHAR_GETSETTERS_PARAMETERS
1044 if (fs_allow_del_at_zero_count == 0)
1045 clear_bit(control_word, eb_s_allow_del_at_zero_count);
1046 else if (fs_allow_del_at_zero_count == 1)
1047 rise_bit(control_word, eb_s_allow_del_at_zero_count);
1049 if (fs_allow_del_at_zero_count == 0 || fs_allow_del_at_zero_count == 1) {
1050#ifdef USE_BIT_FIELDS
1051 conparam.s_allow_del_at_zero_count = fs_allow_del_at_zero_count;
1053 s_allow_del_at_zero_count = fs_allow_del_at_zero_count;
1058 mcerr <<
"ERROR in inline void set_s_allow_del_at_zero_count(int "
1059 "fs_allow_del_at_zero_count):\n";
1060 mcerr <<
"s_allow_del_at_zero_count is outside limits, "
1061 "s_allow_del_at_zero_count=" << int(fs_allow_del_at_zero_count)
1067#ifdef USE_CHAR_GETSETTERS_PARAMETERS
1074 if ((control_word & eb_s_allow_del_at_zero_count) != 0)
1079#elif defined(USE_BIT_FIELDS)
1081 return conparam.s_allow_del_at_zero_count;
1084 {
return s_allow_del_at_zero_count; }
1089#ifdef USE_CHAR_GETSETTERS_PARAMETERS
1095 if (fs_print_adr_cpp == 0 || fs_print_adr_cpp == 1) {
1096 s_print_adr_cpp = fs_print_adr_cpp;
1098 mcerr <<
"ERROR in inline void set_s_print_adr_cpp(int fs_print_adr_cpp "
1100 mcerr <<
"s_print_adr_cpp is outside limits, s_print_adr_cpp="
1101 << int(fs_print_adr_cpp) <<
'\n';
1106#ifdef USE_CHAR_GETSETTERS_PARAMETERS
1112 return s_print_adr_cpp;
1124 if (number_of_booked != 0) {
1125 mcerr <<
"Error in CountPassivePtr::~CountPassivePtr():\n"
1126 <<
" number_of_booked != 0, number_of_booked=" << number_of_booked
1131 mcerr <<
"rpp = NULL\n";
1134 if (rpp != NULL) rpp->cpp = NULL;
1143 if (cpp == NULL)
return NULL;
1144#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1146 if (cpp->get_rpp() == NULL)
return NULL;
1147#ifdef USE_CHECK_DOUBLE_PTR_IN_PASSIVEPTR
1148 X* temp_ptr =
dynamic_cast<X*
>(
const_cast<RegPassivePtr*
>(cpp->get_rpp()));
1149 if (ptr != temp_ptr) {
1150 mcerr <<
"Error in inline X* PassivePtr::get(void):\n";
1151 mcerr <<
"ptr != temp_ptr\n";
1158 return (X*)(cpp->get_rpp());
1187#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1193#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1214#ifdef IMPLICIT_X_STAR
1215 inline operator X*(void)
const;
1221 return cpp->get_number_of_booked();
1223 void print(std::ostream& file,
int l = 1)
const;
1229#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1243 Ifile <<
"PassivePtr<X>:";
1245 file <<
" pointer is NULL, no object, number of ref's is "
1246 << get_total_number_of_references() <<
"\n";
1249 get()->print(file, l);
1252 Ifile <<
"number of ref's is " << get_total_number_of_references() <<
'\n';
1258 Ifile <<
"PassivePtr<X>:";
1259 if (f.
get() == NULL)
1260 file <<
" pointer is NULL, no object, number of ref's is "
1278#ifdef USE_DELETE_AT_ZERO_COUNT
1280 if ((arptr = cpp->get_rpp()) != NULL &&
1284 arptr->s_allow_del_at_zero_count == 1 &&
1286 cpp->get_number_of_booked() == 1)
1291 if (cpp->get_rpp() == NULL && cpp->get_number_of_booked() == 0)
1299#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1306 if (f.cpp != NULL) {
1311#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1317 if (
this != &f) put(f.
get());
1330#ifdef USE_DELETE_AT_ZERO_COUNT
1332 if ((arptr = cpp->get_rpp()) != NULL &&
1336 arptr->s_allow_del_at_zero_count == 1 &&
1338 cpp->get_number_of_booked() == 1)
1343 if (cpp->get_rpp() == NULL && cpp->get_number_of_booked() == 0) {
1349 if (cpp != NULL) cpp->
book();
1350#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1358#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1359#ifdef SKIP_CHECKS_NULL
1363 mcerr <<
"Error in X* PassivePtr<X>::operator->(void) const: cpp == NULL\n";
1364 mcerr <<
"This means that the pointer is emtpy, "
1365 <<
"there is no addressed object.\n";
1366 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1370 if (cpp->get_rpp() == NULL) {
1371 mcerr <<
"Error in X* PassivePtr<X>::operator->(void) const: "
1372 "cpp->get_rpp() == NULL\n";
1373 mcerr <<
"This means that the pointer is emtpy, "
1374 <<
"there is no addressed object.\n";
1375 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1379#ifdef USE_CHECK_DOUBLE_PTR_IN_PASSIVEPTR
1380 X* temp_ptr =
dynamic_cast<X*
>(
const_cast<RegPassivePtr*
>(cpp->get_rpp()));
1381 if (ptr != temp_ptr) {
1382 mcerr <<
"Error in inline X* PassivePtr::operator->(void):\n";
1383 mcerr <<
"ptr != temp_ptr\n";
1390#ifdef SKIP_CHECKS_NULL
1394 mcerr <<
"Error in X* PassivePtr<X>::operator->(void) const: cpp == NULL\n";
1395 mcerr <<
"This means that the pointer is emtpy, "
1396 <<
"there is no addressed object.\n";
1397 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1402 if ((rpp = cpp->get_rpp()) == NULL) {
1403 mcerr <<
"Error in X* PassivePtr<X>::operator->(void) const: "
1404 "cpp->get_rpp() == NULL\n";
1405 mcerr <<
"This means that the pointer is emtpy, "
1406 <<
"there is no addressed object.\n";
1407 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1418#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1419#ifdef SKIP_CHECKS_NULL
1423 mcerr <<
"Error in X& PassivePtr<X>::operator*(void) const: cpp == NULL\n";
1424 mcerr <<
"This means that the pointer is emtpy, "
1425 <<
"there is no addressed object.\n";
1426 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1430 if (cpp->get_rpp() == NULL) {
1431 mcerr <<
"Error in X& PassivePtr<X>::operator*(void) const: cpp->get_rpp() "
1433 mcerr <<
"This means that the pointer is emtpy, "
1434 <<
"there is no addressed object.\n";
1435 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1439#ifdef USE_CHECK_DOUBLE_PTR_IN_PASSIVEPTR
1440 X* temp_ptr =
dynamic_cast<X*
>(
const_cast<RegPassivePtr*
>(cpp->get_rpp()));
1441 if (ptr != temp_ptr) {
1442 mcerr <<
"Error in inline X& PassivePtr::operator*(void):\n";
1443 mcerr <<
"ptr != temp_ptr\n";
1450#ifdef SKIP_CHECKS_NULL
1454 mcerr <<
"Error in X& PassivePtr<X>::operator*(void) const: cpp == NULL\n";
1455 mcerr <<
"This means that the pointer is emtpy, "
1456 <<
"there is no addressed object.\n";
1457 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1471 if ((rpp = cpp->get_rpp()) == NULL) {
1472 mcerr <<
"Error in X& PassivePtr<X>::operator*(void) const: cpp->get_rpp() "
1474 mcerr <<
"This means that the pointer is emtpy, "
1475 <<
"there is no addressed object.\n";
1476 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1481 return *((X*)(rpp));
1487#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1488#ifdef SKIP_CHECKS_NULL
1492 mcerr <<
"Error in X* PassivePtr<X>::getver(void) const: cpp == NULL\n";
1493 mcerr <<
"This means that the pointer is emtpy, "
1494 <<
"there is no addressed object.\n";
1495 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1499 if (cpp->get_rpp() == NULL) {
1500 mcerr <<
"Error in X* PassivePtr<X>::getver(void) const: cpp->get_rpp() == "
1502 mcerr <<
"This means that the pointer is emtpy, "
1503 <<
"there is no addressed object.\n";
1504 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1508#ifdef USE_CHECK_DOUBLE_PTR_IN_PASSIVEPTR
1509 X* temp_ptr =
dynamic_cast<X*
>(
const_cast<RegPassivePtr*
>(cpp->get_rpp()));
1510 if (ptr != temp_ptr) {
1511 mcerr <<
"Error in inline X* PassivePtr::getver(void):\n";
1512 mcerr <<
"ptr != temp_ptr\n";
1519#ifdef SKIP_CHECKS_NULL
1523 mcerr <<
"Error in X* PassivePtr<X>::getver(void) const: cpp == NULL\n";
1524 mcerr <<
"This means that the pointer is emtpy, "
1525 <<
"there is no addressed object.\n";
1526 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1531 if ((rpp = cpp->get_rpp()) == NULL) {
1532 mcerr <<
"Error in X* PassivePtr<X>::getver(void) const: cpp->get_rpp() == "
1534 mcerr <<
"This means that the pointer is emtpy, "
1535 <<
"there is no addressed object.\n";
1536 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1545#ifdef IMPLICIT_X_STAR
1548#ifdef USE_DOUBLE_PTR_IN_PASSIVEPTR
1549#ifdef SKIP_CHECKS_NULL
1553 mcerr <<
"Error in PassivePtr<X>::operator X*(void) const: cpp == NULL\n";
1554 mcerr <<
"This means that the pointer is emtpy, "
1555 <<
"there is no addressed object.\n";
1556 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1560 if (cpp->get_rpp() == NULL) {
1561 mcerr <<
"Error in X* PassivePtr<X>::operator X*(void) const: "
1562 "cpp->get_rpp() == NULL\n";
1563 mcerr <<
"This means that the pointer is emtpy, "
1564 <<
"there is no addressed object.\n";
1565 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1569#ifdef USE_CHECK_DOUBLE_PTR_IN_PASSIVEPTR
1570 X* temp_ptr =
dynamic_cast<X*
>(
const_cast<RegPassivePtr*
>(cpp->get_rpp()));
1571 if (ptr != temp_ptr) {
1572 mcerr <<
"Error in inline X* PassivePtr::operator X*(void):\n";
1573 mcerr <<
"ptr != temp_ptr\n";
1580#ifdef SKIP_CHECKS_NULL
1581 const RegPassivePtr* rpp = cpp->get_rpp();
1585 <<
"Error in X* PassivePtr<X>::operator X*(void) const: cpp == NULL\n";
1586 mcerr <<
"This means that the pointer is emtpy, "
1587 <<
"there is no addressed object.\n";
1588 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1592 const RegPassivePtr* rpp;
1593 if ((rpp = cpp->get_rpp()) == NULL) {
1594 mcerr <<
"Error in X* PassivePtr<X>::operator X*(void) const: "
1595 "cpp->get_rpp() == NULL\n";
1596 mcerr <<
"This means that the pointer is emtpy, "
1597 <<
"there is no addressed object.\n";
1598 mcerr <<
"Type of X is (in internal notations) " <<
typeid(X).name()
1610 return f1.
get() == f2.
get();
1616#ifdef USE_DELETE_AT_ZERO_COUNT
1618 if ((arptr = cpp->get_rpp()) != NULL &&
1622 arptr->s_allow_del_at_zero_count == 1 &&
1624 cpp->get_number_of_booked() == 1)
1629 if (cpp->get_rpp() == NULL && cpp->get_number_of_booked() == 0) {
1639 return f1.
get() < f2.
get();
#define USE_PRIVATE_PARAM_IN_PASSIVEPTR
#define USE_DOUBLE_PTR_IN_PASSIVEPTR
#define USE_DELETE_AT_ZERO_COUNT
Active pointer or automatic container or controlling pointer.
void print(std::ostream &file, int l=1) const
ActivePtr(const ActivePtr< X, C > &f, Pilfer)
X & operator*(void) const
ActivePtr(const X *fptr, Clone)
ActivePtr(const ActivePtr< X, C > &f)
void pilfer(const ActivePtr< X, C > &f)
X * operator->(void) const
virtual ActivePtr * copy() const
ActivePtr & operator=(const ActivePtr< X, C > &f)
Counter of protected pointers.
long get_number_of_booked(void)
void change_rpp(const RegPassivePtr *frpp)
const RegPassivePtr * get_rpp(void)
CountPassivePtr(const RegPassivePtr *frpp)
X * operator->(void) const
PassivePtr< X > & operator=(X *f)
void move_pointer(PassivePtr< X > &f)
long get_total_number_of_references(void) const
PassivePtr< X > & operator=(const PassivePtr< X > &f)
PassivePtr(const PassivePtr< X > &f)
void print(std::ostream &file, int l=1) const
X & operator*(void) const
virtual PassivePtr * copy() const
static char get_s_ban_del_ignore(void)
void clear_pointers(void) const
static void set_s_ban_del_ignore(char fs_ban_del_ignore)
static void set_s_print_adr_cpp(char fs_print_adr_cpp)
virtual void print(std::ostream &file, int l=1) const
static char get_s_print_adr_cpp(void)
RegPassivePtr & operator=(const RegPassivePtr &f)
char get_s_allow_del_at_zero_count(void) const
void set_s_ban_cop(char fs_ban_cop)
RegPassivePtr(char fs_ban_del, char fs_ban_sub, char fs_ban_cop=0)
void set_s_allow_del_at_zero_count(char fs_allow_del_at_zero_count)
char get_s_ban_sub(void) const
virtual RegPassivePtr * copy() const
friend std::ostream & operator<<(std::ostream &file, const RegPassivePtr &f)
void set_s_ban_sub(char fs_ban_sub)
char get_s_ban_cop(void) const
void set_s_ban_del(char fs_ban_del)
char get_s_ban_del(void) const
CountPP_ns::CountPassivePtr * book(void) const
long get_total_number_of_references(void) const
static X * copy(const X *f)
std::istream & operator>>(std::istream &file, EqualStepCoorMesh< T > &f)
std::ostream & noindent(std::ostream &f)
void exchange(ActivePtr< X, C > &f1, ActivePtr< X, C > &f2)
std::ostream & operator<<(std::ostream &file, const BGMesh &bgm)
int operator==(const circumf &f1, const circumf &f2)
bool operator<(PassivePtr< X > f1, PassivePtr< X > f2)
std::ostream & yesindent(std::ostream &f)
#define Iprintn(file, name)