 |
My Project
UNKNOWN_GIT_VERSION
|
#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.
|
void | CountedRefPtr_kill (ring r) |
| Overloading ring destruction. More...
|
|
void | CountedRefPtr_kill (CountedRefData *data) |
| Supporting smart pointer CountedRefPtr . More...
|
|
void * | countedref_Init (blackbox *) |
| blackbox support - initialization More...
|
|
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. More...
|
|
void | countedref_Print (blackbox *, void *ptr) |
| blackbox support - convert to string representation More...
|
|
char * | countedref_String (blackbox *, void *ptr) |
| blackbox support - convert to string representation More...
|
|
void * | countedref_Copy (blackbox *, void *ptr) |
| blackbox support - copy element More...
|
|
BOOLEAN | countedref_Assign (leftv result, leftv arg) |
| blackbox support - assign element More...
|
|
BOOLEAN | countedref_CheckInit (leftv res, leftv arg) |
|
BOOLEAN | countedref_Op1 (int op, leftv res, leftv head) |
| blackbox support - unary operations More...
|
|
static BOOLEAN | countedref_Op2_ (int op, leftv res, leftv head, leftv arg) |
| blackbox support - binary operations (resolve seocnd argument) More...
|
|
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 More...
|
|
void | countedref_destroy (blackbox *, void *ptr) |
| blackbox support - destruction More...
|
|
void * | countedref_InitShared (blackbox *) |
| Blackbox support - generate initialized, but all-zero - shared data. More...
|
|
BOOLEAN | countedref_Op1Shared (int op, leftv res, leftv head) |
| Blackbox support - unary operation for shared data. More...
|
|
BOOLEAN | countedref_Op2Shared (int op, leftv res, leftv head, leftv arg) |
| blackbox support - binary operations More...
|
|
BOOLEAN | countedref_OpM (int op, leftv res, leftv args) |
| blackbox support - n-ary operations More...
|
|
BOOLEAN | countedref_AssignShared (leftv result, leftv arg) |
| blackbox support - assign element More...
|
|
void | countedref_destroyShared (blackbox *, void *ptr) |
| blackbox support - destruction More...
|
|
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. More...
|
|
void | countedref_shared_load () |
|
- 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.
◆ countedref_Assign()
blackbox support - assign element
Definition at line 377 of file countedref.cc.
393 WerrorS(
"Can only take reference from identifier");
◆ countedref_AssignShared()
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.
◆ countedref_CheckAssign()
◆ countedref_CheckInit()
◆ countedref_Copy()
void* countedref_Copy |
( |
blackbox * |
, |
|
|
void * |
ptr |
|
) |
| |
◆ countedref_deserialize()
◆ countedref_destroy()
void countedref_destroy |
( |
blackbox * |
, |
|
|
void * |
ptr |
|
) |
| |
◆ countedref_destroyShared()
void countedref_destroyShared |
( |
blackbox * |
, |
|
|
void * |
ptr |
|
) |
| |
◆ countedref_Init()
void* countedref_Init |
( |
blackbox * |
| ) |
|
◆ countedref_InitShared()
void* countedref_InitShared |
( |
blackbox * |
| ) |
|
Blackbox support - generate initialized, but all-zero - shared data.
Definition at line 540 of file countedref.cc.
◆ countedref_Op1()
blackbox support - unary operations
Definition at line 406 of file countedref.cc.
◆ countedref_Op1Shared()
Blackbox support - unary operation for shared data.
Definition at line 546 of file countedref.cc.
569 int typ =
head->Typ();
◆ countedref_Op2()
◆ countedref_Op2_()
blackbox support - binary operations (resolve seocnd argument)
Definition at line 427 of file countedref.cc.
◆ countedref_Op2Shared()
blackbox support - binary operations
Definition at line 576 of file countedref.cc.
583 int typ =
head->Typ();
◆ countedref_Op3()
blackbox support - ternary operations
Definition at line 471 of file countedref.cc.
◆ countedref_Op3_()
◆ countedref_Op3__()
◆ countedref_OpM()
blackbox support - n-ary operations
Definition at line 592 of file countedref.cc.
604 (
char*)
next->Data(): (
char*)
next->Name());
607 if (strcmp(
name,
"help") == 0)
609 PrintS(
"system(<ref>, ...): extended functionality for reference/shared data <ref>\n");
610 PrintS(
" system(<ref>, count) - number of references pointing to <ref>\n");
611 PrintS(
" system(<ref>, enumerate) - unique number for identifying <ref>\n");
612 PrintS(
" system(<ref>, undefined) - checks whether <ref> had been assigned\n");
613 PrintS(
" system(<ref>, \"help\") - prints this information message\n");
614 PrintS(
" system(<ref>, \"typeof\") - actual type referenced by <ref>\n");
615 PrintS(
" system(<ref1>, same, <ref2>) - tests for identic reference objects\n");
618 if (strncmp(
name,
"undef", 5) == 0)
631 if (strncmp(
name,
"count", 5) == 0)
return obj.
count(
res);
633 if (strcmp(
name,
"name") == 0)
return obj.
name(
res);
634 if (strncmp(
name,
"typ", 3) == 0)
return obj.
type(
res);
◆ countedref_Print()
void countedref_Print |
( |
blackbox * |
, |
|
|
void * |
ptr |
|
) |
| |
blackbox support - convert to string representation
Definition at line 356 of file countedref.cc.
359 else PrintS(
"<unassigned reference or shared memory>");
◆ countedref_reference_load()
void countedref_reference_load |
( |
| ) |
|
Initialize blackbox
types 'reference' and 'shared', or both.
Definition at line 700 of file countedref.cc.
706 blackbox *bbx = (blackbox*)
omAlloc0(
sizeof(blackbox));
◆ countedref_serialize()
◆ countedref_shared_load()
void countedref_shared_load |
( |
| ) |
|
◆ countedref_String()
char* countedref_String |
( |
blackbox * |
, |
|
|
void * |
ptr |
|
) |
| |
blackbox support - convert to string representation
Definition at line 363 of file countedref.cc.
◆ CountedRefPtr_kill() [1/2]
◆ CountedRefPtr_kill() [2/2]
void CountedRefPtr_kill |
( |
ring |
r | ) |
|
|
inline |
BOOLEAN type(leftv res)
Get type of references data.
BOOLEAN countedref_Assign(leftv result, leftv arg)
blackbox support - assign element
BOOLEAN countedref_Op1Shared(int op, leftv res, leftv head)
Blackbox support - unary operation for shared data.
int newstruct_desc_size()
BOOLEAN likewise(leftv res, leftv arg)
Check for likewise identifiers.
static BOOLEAN is_ref(leftv arg)
Check whether argument is already a reference type.
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
BOOLEAN countedref_CheckAssign(blackbox *, leftv, leftv)
We use the function pointer as a marker of reference types for CountedRef::is_ref(leftv),...
void countedref_destroy(blackbox *, void *ptr)
blackbox support - destruction
static BOOLEAN countedref_Op2_(int op, leftv res, leftv head, leftv arg)
blackbox support - binary operations (resolve seocnd argument)
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
BOOLEAN dereference(leftv arg)
Replaces argument by a shallow copy of the references data.
Class used for (list of) interpreter objects.
BOOLEAN enumerate(leftv res)
BOOLEAN name(leftv res)
Get (possibly) internal identifier name.
static BOOLEAN resolve(leftv arg)
If necessary dereference.
static BOOLEAN countedref_Op3_(int op, leftv res, leftv head, leftv arg1, leftv arg2)
BOOLEAN countedref_Op2(int op, leftv res, leftv head, leftv arg)
char * countedref_String(blackbox *, void *ptr)
blackbox support - convert to string representation
BOOLEAN countedref_Op3(int op, leftv res, leftv head, leftv arg1, leftv arg2)
blackbox support - ternary operations
BOOLEAN retrieve(leftv res, int typ)
Recover more information (e.g. subexpression data) from computed result.
void PrintS(const char *s)
BOOLEAN assign(leftv result, leftv arg)
void destruct()
Kills a link to the referenced object.
BOOLEAN countedref_serialize(blackbox *, void *d, si_link f)
BOOLEAN countedref_AssignShared(leftv result, leftv arg)
blackbox support - assign element
int blackboxIsCmd(const char *n, int &tok)
used by scanner: returns ROOT_DECL for known types (and the type number in tok)
BOOLEAN countedref_OpM(int op, leftv res, leftv args)
blackbox support - n-ary operations
BOOLEAN countedref_Op1(int op, leftv res, leftv head)
blackbox support - unary operations
void countedref_destroyShared(blackbox *, void *ptr)
blackbox support - destruction
BOOLEAN jjLIST_PL(leftv res, leftv v)
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
BOOLEAN count(leftv res)
Get number of references pointing here, too.
static self cast(void *data)
Recover the actual object from raw Singular data.
BOOLEAN countedref_deserialize(blackbox **, void **d, si_link f)
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
void * countedref_InitShared(blackbox *)
Blackbox support - generate initialized, but all-zero - shared data.
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
BOOLEAN same(leftv res, leftv arg)
Check for identical reference objects.
void * countedref_Init(blackbox *)
blackbox support - initialization
BOOLEAN unassigned() const
Check whether (shared) data was initialized but not assigned yet.
char name(const Variable &v)
void WerrorS(const char *s)
self wrapid()
Temporarily wrap with identifier for '[' and '.' operation.
static self cast(leftv arg)
Recovering outcasted CountedRefShared object from interpreter object.
static BOOLEAN construct(leftv res, long data)
Construct integer value.
static BOOLEAN countedref_Op3__(int op, leftv res, leftv head, leftv arg1, leftv arg2)
BOOLEAN outcast(leftv res, int typ)
Construct reference data object marked by given identifier number.
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
void countedref_Print(blackbox *, void *ptr)
blackbox support - convert to string representation
void * countedref_Copy(blackbox *, void *ptr)
blackbox support - copy element
BOOLEAN countedref_Op2Shared(int op, leftv res, leftv head, leftv arg)
blackbox support - binary operations
BOOLEAN countedref_CheckInit(leftv res, leftv arg)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type