Loading...
Searching...
No Matches
countedref.cc File Reference
`#include "kernel/mod2.h"`
`#include "ipid.h"`
`#include "countedref.h"`
`#include "blackbox.h"`
`#include "newstruct.h"`
`#include "ipshell.h"`

Go to the source code of this file.

## Data Structures

class | CountedRefData
| This class stores a reference counter as well as a Singular interpreter object. More...
class | CountedRef
class | CountedRefShared

## Functions

void | CountedRefPtr_kill (ring r)
| Overloading ring destruction.
void | CountedRefPtr_kill (CountedRefData *data)
| Supporting smart pointer `CountedRefPtr`.
void * | countedref_Init (blackbox *)
| blackbox support - initialization
BOOLEAN | countedref_CheckAssign (blackbox *, leftv, leftv)
| We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv), see the latter for details.
void | countedref_Print (blackbox *, void *ptr)
| blackbox support - convert to string representation
char * | countedref_String (blackbox *, void *ptr)
| blackbox support - convert to string representation
void * | countedref_Copy (blackbox *, void *ptr)
| blackbox support - copy element
BOOLEAN | countedref_Assign (leftv result, leftv arg)
| blackbox support - assign element
BOOLEAN | countedref_CheckInit (leftv res, leftv arg)
BOOLEAN | countedref_Op1 (int op, leftv res, leftv head)
| blackbox support - unary operations
static BOOLEAN | countedref_Op2_ (int op, leftv res, leftv head, leftv arg)
| blackbox support - binary operations (resolve seocnd argument)
BOOLEAN | countedref_Op2 (int op, leftv res, leftv head, leftv arg)
static BOOLEAN | countedref_Op3__ (int op, leftv res, leftv head, leftv arg1, leftv arg2)
static BOOLEAN | countedref_Op3_ (int op, leftv res, leftv head, leftv arg1, leftv arg2)
BOOLEAN | countedref_Op3 (int op, leftv res, leftv head, leftv arg1, leftv arg2)
| blackbox support - ternary operations
void | countedref_destroy (blackbox *, void *ptr)
| blackbox support - destruction
void * | countedref_InitShared (blackbox *)
| Blackbox support - generate initialized, but all-zero - shared data.
BOOLEAN | countedref_Op1Shared (int op, leftv res, leftv head)
| Blackbox support - unary operation for shared data.
BOOLEAN | countedref_Op2Shared (int op, leftv res, leftv head, leftv arg)
| blackbox support - binary operations
BOOLEAN | countedref_OpM (int op, leftv res, leftv args)
| blackbox support - n-ary operations
BOOLEAN | countedref_AssignShared (leftv result, leftv arg)
| blackbox support - assign element
void | countedref_destroyShared (blackbox *, void *ptr)
| blackbox support - destruction
BOOLEAN | countedref_serialize (blackbox *, void *d, si_link f)
BOOLEAN | countedref_deserialize (blackbox **, void **d, si_link f)
void | countedref_reference_load ()
| Initialize `blackbox` types 'reference' and 'shared', or both.
void | countedref_shared_load ()

## Detailed Description

Author
  Alexander Dreyer

Date
  2012-08-15

This file defines reference countes interpreter objects and adds the `blackbox` operations for high-level types 'reference' and 'shared'.

Note
  This works was supported by the "Industrial Algebra" project.

Copyright:
  (c) 2012 by The Singular Team, see LICENSE file

Definition in file countedref.cc.

## Function Documentation

## countedref_Assign()

BOOLEAN countedref_Assign | ( | leftv | result,
|  | leftv | arg )

blackbox support - assign element

Definition at line 377 of file countedref.cc.

{
// Case: replace assignment behind reference
if (result->Data() != NULL) {
CountedRef ref = CountedRef::cast(result);
return CountedRef::resolve(arg) || ref.assign(result, arg);
}
// Case: copy reference
if (result->Typ() == arg->Typ())
return CountedRef::cast(arg).outcast(result);
// Case: new reference
if ((arg->rtyp == IDHDL) || CountedRef::is_ref(arg))
return CountedRef(arg).outcast(result);
WerrorS("Can only take reference from identifier");
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
CountedRef
Definition countedref.cc:199
CountedRef::resolve
static BOOLEAN resolve(leftv arg)
If necessary dereference.
Definition countedref.cc:324
CountedRef::outcast
BOOLEAN outcast(leftv res, int typ)
Construct reference data object marked by given identifier number.
Definition countedref.cc:247
CountedRef::assign
BOOLEAN assign(leftv result, leftv arg)
Definition countedref.cc:239
CountedRef::is_ref
static BOOLEAN is_ref(leftv arg)
Check whether argument is already a reference type.
Definition countedref.cc:216
CountedRef::cast
static self cast(void *data)
Recover the actual object from raw Singular data.
Definition countedref.cc:312
sleftv::Typ
int Typ()
Definition subexpr.cc:1048
sleftv::rtyp
int rtyp
Definition subexpr.h:91
result
return result
Definition facAbsBiFact.cc:76
WerrorS
void WerrorS(const char *s)
Definition feFopen.cc:24
NULL
#define NULL
Definition omList.c:12
IDHDL
#define IDHDL
Definition tok.h:31

## countedref_AssignShared()

BOOLEAN countedref_AssignShared | ( | leftv | result,
|  | leftv | arg )

blackbox support - assign element

Case: replace assignment behind reference

Case: new reference to already shared data

Case: new shared data

Definition at line 648 of file countedref.cc.

{
/// Case: replace assignment behind reference
if ((result->Data() != NULL) && !CountedRefShared::cast(result).unassigned()) {
CountedRef ref = CountedRef::cast(result);
return CountedRef::resolve(arg) || ref.assign(result, arg);
}
/// Case: new reference to already shared data
if (result->Typ() == arg->Typ())
{
if (result->Data() != NULL)
CountedRefShared::cast(result).destruct();
return CountedRefShared::cast(arg).outcast(result);
}
if(CountedRefShared::cast(result).unassigned())
{
return CountedRefShared::cast(result).assign(result, arg);
}
/// Case: new shared data
return CountedRefShared(arg).outcast(result);
}
CountedRefShared
Definition countedref.cc:492
CountedRefShared::cast
static self cast(leftv arg)
Recovering outcasted CountedRefShared object from interpreter object.
Definition countedref.cc:521
CountedRef::destruct
void destruct()
Kills a link to the referenced object.
Definition countedref.cc:268

## countedref_CheckAssign()

BOOLEAN countedref_CheckAssign | ( | blackbox * | ,
|  | leftv | ,
|  | leftv | )

We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv), see the latter for details.

Definition at line 193 of file countedref.cc.

{
return FALSE;
}
FALSE
#define FALSE
Definition auxiliary.h:97

## countedref_CheckInit()

BOOLEAN countedref_CheckInit | ( | leftv | res,
|  | leftv | arg )

Definition at line 397 of file countedref.cc.

{
if (arg->Data() != NULL) return FALSE;
res->rtyp = NONE;
WerrorS("Noninitialized access");
return TRUE;
}
sleftv::Data
void * Data()
Definition subexpr.cc:1192
res
CanonicalForm res
Definition facAbsFact.cc:60
NONE
#define NONE
Definition tok.h:223

## countedref_Copy()

void * countedref_Copy | ( | blackbox * | ,
|  | void * | ptr )

blackbox support - copy element

Definition at line 370 of file countedref.cc.

{
if (ptr) return CountedRef::cast(ptr).outcast();
return NULL;
}

## countedref_deserialize()

BOOLEAN countedref_deserialize | ( | blackbox ** | ,
|  | void ** | d,
|  | si_link | f )

Definition at line 691 of file countedref.cc.

{
// rtyp must be set correctly (to the blackbox id) by routine calling
leftv data=f->m->Read(f);
CountedRefShared sh(data);
*d = sh.outcast();
return FALSE;
}
f
FILE * f
Definition checklibs.c:9
leftv
sleftv * leftv
Definition structs.h:53

## countedref_destroy()

void countedref_destroy | ( | blackbox * | ,
|  | void * | ptr )

blackbox support - destruction

Definition at line 484 of file countedref.cc.

{
if (ptr) CountedRef::cast(ptr).destruct();
}

## countedref_destroyShared()

void countedref_destroyShared | ( | blackbox * | ,
|  | void * | ptr )

blackbox support - destruction

Definition at line 673 of file countedref.cc.

{
if (ptr) CountedRefShared::cast(ptr).destruct();
}

## countedref_Init()

void * countedref_Init | ( | blackbox * |  | ) |

blackbox support - initialization

Definition at line 186 of file countedref.cc.

{
return NULL;
}

## countedref_InitShared()

void * countedref_InitShared | ( | blackbox * |  | ) |

Blackbox support - generate initialized, but all-zero - shared data.

Definition at line 540 of file countedref.cc.

{
return CountedRefShared().outcast();
}

## countedref_Op1()

BOOLEAN countedref_Op1 | ( | int | op,
|  | leftv | res,
|  | leftv | head )

blackbox support - unary operations

Definition at line 406 of file countedref.cc.

{
if(op == TYPEOF_CMD)
return blackboxDefaultOp1(op, res, head);
if (countedref_CheckInit(res, head)) return TRUE;
if ((op == DEF_CMD) || (op == head->Typ()))
{
res->rtyp = head->Typ();
return iiAssign(res, head);
}
CountedRef ref = CountedRef::cast(head);
return ref.dereference(head) ||
iiExprArith1(res, head, op == LINK_CMD? head->Typ(): op);
}
blackboxDefaultOp1
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
Definition blackbox.cc:78
head
CanonicalForm head(const CanonicalForm &f)
Definition canonicalform.h:360
CountedRef::dereference
BOOLEAN dereference(leftv arg)
Replaces argument by a shallow copy of the references data.
Definition countedref.cc:274
countedref_CheckInit
BOOLEAN countedref_CheckInit(leftv res, leftv arg)
Definition countedref.cc:397
iiExprArith1
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Definition iparith.cc:9365
iiAssign
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition ipassign.cc:2099
DEF_CMD
@ DEF_CMD
Definition tok.h:58
LINK_CMD
@ LINK_CMD
Definition tok.h:117
TYPEOF_CMD
@ TYPEOF_CMD
Definition tok.h:196

## countedref_Op1Shared()

BOOLEAN countedref_Op1Shared | ( | int | op,
|  | leftv | res,
|  | leftv | head )

Blackbox support - unary operation for shared data.

Definition at line 546 of file countedref.cc.

{
if(op == TYPEOF_CMD)
return blackboxDefaultOp1(op, res, head);
if (countedref_CheckInit(res, head)) return TRUE;
if ((op == DEF_CMD) || (op == head->Typ()))
{
res->rtyp = head->Typ();
return iiAssign(res, head);
}
CountedRefShared ref = CountedRefShared::cast(head);
if (op == LINK_CMD)
{
if (ref.dereference(head)) return TRUE;
res->Copy(head);
return (res->Typ() == NONE);
}
CountedRefShared wrap = ref.wrapid();
int typ = head->Typ();
return wrap.dereference(head) || iiExprArith1(res, head, op) ||
wrap.retrieve(res, typ);
}
CountedRefShared::retrieve
BOOLEAN retrieve(leftv res, int typ)
Recover more information (e.g. subexpression data) from computed result.
Definition countedref.cc:533
CountedRefShared::wrapid
self wrapid()
Temporarily wrap with identifier for '[' and '.' operation.
Definition countedref.cc:527

## countedref_Op2()

BOOLEAN countedref_Op2 | ( | int | op,
|  | leftv | res,
|  | leftv | head,
|  | leftv | arg )

Definition at line 437 of file countedref.cc.

{
if (countedref_CheckInit(res, head)) return TRUE;
if (CountedRef::is_ref(head))
{
CountedRef ref = CountedRef::cast(head);
return ref.dereference(head) || countedref_Op2_(op, res, head, arg);
}
return countedref_Op2_(op, res, head, arg);
}
countedref_Op2_
static BOOLEAN countedref_Op2_(int op, leftv res, leftv head, leftv arg)
blackbox support - binary operations (resolve seocnd argument)
Definition countedref.cc:427

## countedref_Op2_()

BOOLEAN countedref_Op2_ | ( | int | op,
|  | leftv | res,
|  | leftv | head,
|  | leftv | arg )

static

blackbox support - binary operations (resolve seocnd argument)

Definition at line 427 of file countedref.cc.

{
if (CountedRef::is_ref(arg))
{
CountedRef ref = CountedRef::cast(arg);
return ref.dereference(arg) || iiExprArith2(res, head, op, arg);
}
return iiExprArith2(res, head, op, arg);
}
iiExprArith2
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
Definition iparith.cc:9176

## countedref_Op2Shared()

BOOLEAN countedref_Op2Shared | ( | int | op,
|  | leftv | res,
|  | leftv | head,
|  | leftv | arg )

blackbox support - binary operations

Definition at line 576 of file countedref.cc.

{
if (countedref_CheckInit(res, head)) return TRUE;
if (CountedRefShared::is_ref(head))
{
CountedRefShared wrap = CountedRefShared::cast(head).wrapid();
int typ = head->Typ();
return wrap.dereference(head) || countedref_Op2_(op, res, head, arg) ||
wrap.retrieve(res, typ);
}
return countedref_Op2_(op, res, head, arg);
}

## countedref_Op3()

BOOLEAN countedref_Op3 | ( | int | op,
|  | leftv | res,
|  | leftv | head,
|  | leftv | arg1,
|  | leftv | arg2 )

blackbox support - ternary operations

Definition at line 471 of file countedref.cc.

{
if (countedref_CheckInit(res, head)) return TRUE;
if (CountedRef::is_ref(head))
{
CountedRef ref = CountedRef::cast(head);
return ref.dereference(head) || countedref_Op3_(op, res, head, arg1, arg2);
}
return countedref_Op3_(op, res, head, arg1, arg2);
}
countedref_Op3_
static BOOLEAN countedref_Op3_(int op, leftv res, leftv head, leftv arg1, leftv arg2)
Definition countedref.cc:459

## countedref_Op3_()

BOOLEAN countedref_Op3_ | ( | int | op,
|  | leftv | res,
|  | leftv | head,
|  | leftv | arg1,
|  | leftv | arg2 )

static

Definition at line 459 of file countedref.cc.

{
if (CountedRef::is_ref(arg1))
{
CountedRef ref = CountedRef::cast(arg1);
return ref.dereference(arg1) || countedref_Op3__(op, res, head, arg1, arg2);
}
return countedref_Op3__(op, res, head, arg1, arg2);
}
countedref_Op3__
static BOOLEAN countedref_Op3__(int op, leftv res, leftv head, leftv arg1, leftv arg2)
Definition countedref.cc:448

## countedref_Op3__()

BOOLEAN countedref_Op3__ | ( | int | op,
|  | leftv | res,
|  | leftv | head,
|  | leftv | arg1,
|  | leftv | arg2 )

static

Definition at line 448 of file countedref.cc.

{
if (CountedRef::is_ref(arg2))
{
CountedRef ref = CountedRef::cast(arg2);
return ref.dereference(arg2) || iiExprArith3(res, op, head, arg1, arg2);
}
return iiExprArith3(res, op, head, arg1, arg2);
}
iiExprArith3
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
Definition iparith.cc:9575

## countedref_OpM()

BOOLEAN countedref_OpM | ( | int | op,
|  | leftv | res,
|  | leftv | args )

blackbox support - n-ary operations

Definition at line 592 of file countedref.cc.

{
if (args->Data() == NULL) return FALSE;
if(op == SYSTEM_CMD)
{
if (args->next)
{
leftv next = args->next;
args->next = NULL;
char* name = (next->Typ() == STRING_CMD?
(char*) next->Data(): (char*)next->Name());
next = next->next;
if (strcmp(name, "help") == 0)
{
PrintS("system(<ref>, ...): extended functionality for reference/shared data <ref>\n");
PrintS(" system(<ref>, count) - number of references pointing to <ref>\n");
PrintS(" system(<ref>, enumerate) - unique number for identifying <ref>\n");
PrintS(" system(<ref>, undefined) - checks whether <ref> had been assigned\n");
PrintS(" system(<ref>, \"help\") - prints this information message\n");
PrintS(" system(<ref>, \"typeof\") - actual type referenced by <ref>\n");
PrintS(" system(<ref1>, same, <ref2>) - tests for identic reference objects\n");
return CountedRef::construct(res);
}
if (strncmp(name, "undef", 5) == 0)
{
return CountedRef::construct(res, args->Data()?
(CountedRef::cast(args).unassigned()? 1: 2): 0);
}
CountedRef obj = CountedRef::cast(args);
if (next)
{
if (strcmp(name, "same") == 0) return obj.same(res, next);
// likewise may be hard to interprete, so we not not document it above
if (strncmp(name, "like", 4) == 0) return obj.likewise(res, next);
}
if (strncmp(name, "count", 5) == 0) return obj.count(res);
if (strncmp(name, "enum", 4) == 0) return obj.enumerate(res);
if (strcmp(name, "name") == 0) return obj.name(res); // undecumented
if (strncmp(name, "typ", 3) == 0) return obj.type(res);
}
return TRUE;
}
if (op == LIST_CMD)
{
res->rtyp = op;
return jjLIST_PL(res, args);
}
CountedRef ref = CountedRef::cast(args);
return ref.dereference(args) || iiExprArithM(res, args, op);
}
CountedRef::type
BOOLEAN type(leftv res)
Get type of references data.
Definition countedref.cc:304
CountedRef::likewise
BOOLEAN likewise(leftv res, leftv arg)
Check for likewise identifiers.
Definition countedref.cc:294
CountedRef::enumerate
BOOLEAN enumerate(leftv res)
Definition countedref.cc:291
CountedRef::same
BOOLEAN same(leftv res, leftv arg)
Check for identical reference objects.
Definition countedref.cc:299
CountedRef::construct
static BOOLEAN construct(leftv res, long data)
Construct integer value.
Definition countedref.cc:331
CountedRef::name
BOOLEAN name(leftv res)
Get (possibly) internal identifier name.
Definition countedref.cc:309
CountedRef::count
BOOLEAN count(leftv res)
Get number of references pointing here, too.
Definition countedref.cc:288
sleftv::next
leftv next
Definition subexpr.h:86
name
char name(const Variable &v)
Definition factory.h:189
iiExprArithM
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
Definition iparith.cc:9666
jjLIST_PL
BOOLEAN jjLIST_PL(leftv res, leftv v)
Definition iparith.cc:8250
next
ListNode * next
Definition janet.h:31
PrintS
void PrintS(const char *s)
Definition reporter.cc:288
LIST_CMD
@ LIST_CMD
Definition tok.h:118
STRING_CMD
@ STRING_CMD
Definition tok.h:187
SYSTEM_CMD
@ SYSTEM_CMD
Definition tok.h:189

## countedref_Print()

void countedref_Print | ( | blackbox * | ,
|  | void * | ptr )

blackbox support - convert to string representation

Definition at line 356 of file countedref.cc.

{
if (ptr) (*CountedRef::cast(ptr))->Print();
else PrintS("<unassigned reference or shared memory>");
}
Print
#define Print
Definition emacs.cc:80

## countedref_reference_load()

void countedref_reference_load | ( |  | ) |

Initialize `blackbox` types 'reference' and 'shared', or both.

Definition at line 700 of file countedref.cc.

{
int tok;
if (blackboxIsCmd("reference", tok) == ROOT_DECL)
return;
blackbox *bbx = (blackbox*)omAlloc0(sizeof(blackbox));
bbx->blackbox_CheckAssign = countedref_CheckAssign;
bbx->blackbox_destroy = countedref_destroy;
bbx->blackbox_String = countedref_String;
bbx->blackbox_Print = countedref_Print;
bbx->blackbox_Init = countedref_Init;
bbx->blackbox_Copy = countedref_Copy;
bbx->blackbox_Assign = countedref_Assign;
bbx->blackbox_Op1 = countedref_Op1;
bbx->blackbox_Op2 = countedref_Op2;
bbx->blackbox_Op3 = countedref_Op3;
bbx->blackbox_OpM = countedref_OpM;
bbx->blackbox_serialize = countedref_serialize;
bbx->blackbox_deserialize = countedref_deserialize;
bbx->data = omAlloc0(newstruct_desc_size());
setBlackboxStuff(bbx, "reference");
}
setBlackboxStuff
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
Definition blackbox.cc:143
blackboxIsCmd
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
Definition blackbox.cc:219
countedref_String
char * countedref_String(blackbox *, void *ptr)
blackbox support - convert to string representation
Definition countedref.cc:363
countedref_serialize
BOOLEAN countedref_serialize(blackbox *, void *d, si_link f)
Definition countedref.cc:679
countedref_Print
void countedref_Print(blackbox *, void *ptr)
blackbox support - convert to string representation
Definition countedref.cc:356
countedref_deserialize
BOOLEAN countedref_deserialize(blackbox **, void **d, si_link f)
Definition countedref.cc:691
countedref_OpM
BOOLEAN countedref_OpM(int op, leftv res, leftv args)
blackbox support - n-ary operations
Definition countedref.cc:592
countedref_Op3
BOOLEAN countedref_Op3(int op, leftv res, leftv head, leftv arg1, leftv arg2)
blackbox support - ternary operations
Definition countedref.cc:471
countedref_Assign
BOOLEAN countedref_Assign(leftv result, leftv arg)
blackbox support - assign element
Definition countedref.cc:377
countedref_Op2
BOOLEAN countedref_Op2(int op, leftv res, leftv head, leftv arg)
Definition countedref.cc:437
countedref_Init
void * countedref_Init(blackbox *)
blackbox support - initialization
Definition countedref.cc:186
countedref_destroy
void countedref_destroy(blackbox *, void *ptr)
blackbox support - destruction
Definition countedref.cc:484
countedref_Op1
BOOLEAN countedref_Op1(int op, leftv res, leftv head)
blackbox support - unary operations
Definition countedref.cc:406
countedref_CheckAssign
BOOLEAN countedref_CheckAssign(blackbox *, leftv, leftv)
We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv),...
Definition countedref.cc:193
countedref_Copy
void * countedref_Copy(blackbox *, void *ptr)
blackbox support - copy element
Definition countedref.cc:370
ROOT_DECL
@ ROOT_DECL
Definition grammar.cc:320
newstruct_desc_size
int newstruct_desc_size()
Definition newstruct.cc:42
omAlloc0
#define omAlloc0(size)
Definition omAllocDecl.h:211

## countedref_serialize()

BOOLEAN countedref_serialize | ( | blackbox * | ,
|  | void * | d,
|  | si_link | f )

Definition at line 679 of file countedref.cc.

{
sleftv l;
memset(&l,0,sizeof(l));
l.rtyp = STRING_CMD;
l.data = (void*)omStrDup("shared"); // references are converted
f->m->Write(f, &l);
CountedRefShared::cast(d).dereference(&l);
f->m->Write(f, &l);
return FALSE;
}
l
int l
Definition cfEzgcd.cc:100
sleftv
Class used for (list of) interpreter objects.
Definition subexpr.h:83
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263

## countedref_shared_load()

void countedref_shared_load | ( |  | ) |

Definition at line 724 of file countedref.cc.

{
int tok;
if (blackboxIsCmd("shared", tok) == ROOT_DECL)
return;
blackbox *bbxshared = (blackbox*)omAlloc0(sizeof(blackbox));
bbxshared->blackbox_String = countedref_String;
bbxshared->blackbox_Print = countedref_Print;
bbxshared->blackbox_Copy = countedref_Copy;
bbxshared->blackbox_Op3 = countedref_Op3;
bbxshared->blackbox_OpM = countedref_OpM;
bbxshared->blackbox_serialize = countedref_serialize;
bbxshared->blackbox_deserialize = countedref_deserialize;
bbxshared->blackbox_CheckAssign = countedref_CheckAssign;
bbxshared->blackbox_Assign = countedref_AssignShared;
bbxshared->blackbox_destroy = countedref_destroyShared;
bbxshared->blackbox_Op1 = countedref_Op1Shared;
bbxshared->blackbox_Op2 = countedref_Op2Shared;
bbxshared->blackbox_Init = countedref_InitShared;
bbxshared->data = omAlloc0(newstruct_desc_size());
setBlackboxStuff(bbxshared, "shared");
}
countedref_Op2Shared
BOOLEAN countedref_Op2Shared(int op, leftv res, leftv head, leftv arg)
blackbox support - binary operations
Definition countedref.cc:576
countedref_destroyShared
void countedref_destroyShared(blackbox *, void *ptr)
blackbox support - destruction
Definition countedref.cc:673
countedref_InitShared
void * countedref_InitShared(blackbox *)
Blackbox support - generate initialized, but all-zero - shared data.
Definition countedref.cc:540
countedref_AssignShared
BOOLEAN countedref_AssignShared(leftv result, leftv arg)
blackbox support - assign element
Definition countedref.cc:648
countedref_Op1Shared
BOOLEAN countedref_Op1Shared(int op, leftv res, leftv head)
Blackbox support - unary operation for shared data.
Definition countedref.cc:546

## countedref_String()

char * countedref_String | ( | blackbox * | ,
|  | void * | ptr )

blackbox support - convert to string representation

Definition at line 363 of file countedref.cc.

{
if (ptr == NULL) return omStrDup(sNoName_fe);
return (*CountedRef::cast(ptr))->String();
}
sNoName_fe
const char sNoName_fe[]
Definition fevoices.cc:57

## CountedRefPtr_kill() [1/2]

void CountedRefPtr_kill | ( | CountedRefData * | data | ) |

inline

Supporting smart pointer `CountedRefPtr`.

Definition at line 182 of file countedref.cc.

{ delete data; }

## CountedRefPtr_kill() [2/2]

void CountedRefPtr_kill | ( | ring | r | ) |

inline

Overloading ring destruction.

Definition at line 34 of file countedref.cc.

{ rKill(r); }
rKill
void rKill(ring r)
Definition ipshell.cc:6181