Mercurial > repo
view interps/rail/src/Binding.cpp @ 11633:a56795ce5d0a draft
<oerjan> le/rn hammurabi//If anyone creates a webpage that unexpectedly starts playing sounds, he shall be put to death. http://45338297.weebly.com/laws-on-property-and-theft.html
author | HackEso <hackeso@esolangs.org> |
---|---|
date | Tue, 23 Oct 2018 23:09:55 +0000 |
parents | 859f9b4339e6 |
children |
line wrap: on
line source
// Binding.cpp #include "lib.h" #include "Var.h" #include "Binding.h" using namespace std; Binding::Binding() : data(NULL) { } Binding::Binding(Var * newData) { data = newData; if (!null()) { data->acquire(); } } Binding::~Binding() { if (!null()) { data->release(); } } Binding::Binding(Binding const & right) { data = right.data; if (!null()) { data->acquire(); } } Binding & Binding::operator=(Binding const & right) { Binding temp(right); swap(data, temp.data); return *this; } Var * Binding::operator->(void) { return data; } Var const * Binding::operator->(void) const { return data; } Var & Binding::operator*(void) { return *data; } Var const & Binding::operator*(void) const { return*data; } bool Binding::null(void) { return data == NULL; }