Exemplo n.º 1
0
File::~File() {
    // assert(dia_id_ != 0);
    if (reference_count() != 0) {
        die("File[" << this << "]::~File() called "
            "but " << reference_count() << " File::Writer "
            "handles are still open.");
    }
    logger()
        << "class" << "File"
        << "event" << "close"
        << "id" << id_
        << "dia_id" << dia_id_
        << "items" << stats_items_
        << "bytes" << stats_bytes_;
}
Exemplo n.º 2
0
QoreValueList* QoreValueList::splice(ptrdiff_t offset, ExceptionSink* xsink) {
   assert(reference_count() == 1);
   size_t n_offset = priv->checkOffset(offset);
   if (n_offset == priv->length)
      return 0;
   return priv->spliceIntern(n_offset, priv->length - n_offset, xsink);
}
Exemplo n.º 3
0
QoreValueList* QoreValueList::extract(ptrdiff_t offset, ptrdiff_t len, ExceptionSink* xsink) {
   assert(reference_count() == 1);
   size_t n_offset, n_len;
   priv->checkOffset(offset, len, n_offset, n_len);
   if (n_offset == priv->length)
      return new QoreValueList;
   return priv->spliceIntern(n_offset, n_len, xsink, true);
}
Exemplo n.º 4
0
void QoreValueList::insert(QoreValue val) {
   assert(reference_count() == 1);
   priv->resize(priv->length + 1);
   if (priv->length - 1)
      memmove(priv->entry + 1, priv->entry, sizeof(QoreValue) * (priv->length - 1));
   priv->entry[0] = val;
   if (val.hasNode() && get_container_obj(val.getInternalNode()))
      priv->incObjectCount(1);
}
Exemplo n.º 5
0
void QoreValueList::merge(const QoreValueList* list) {
   assert(reference_count() == 1);
   int start = priv->length;
   priv->resize(priv->length + list->priv->length);
   for (size_t i = 0; i < list->priv->length; i++) {
      QoreValue p = list->priv->entry[i];
      priv->entry[start + i] = p.refSelf();
      if (p.hasNode() && get_container_obj(p.getInternalNode()))
	 priv->incObjectCount(1);
   }
}
Exemplo n.º 6
0
QoreValue QoreValueList::pop() {
   assert(reference_count() == 1);
   if (!priv->length)
      return QoreValue();
   QoreValue& rv = priv->entry[priv->length - 1];
   size_t pos = priv->length - 1;
   priv->entry[pos] = QoreValue();
   priv->resize(pos);

   if (rv.hasNode() && get_container_obj(rv.getInternalNode()))
      priv->incObjectCount(-1);

   return rv;
}
Exemplo n.º 7
0
QoreValueList* QoreValueList::splice(ptrdiff_t offset, ptrdiff_t len, const QoreValue l, ExceptionSink* xsink) {
   assert(reference_count() == 1);
   size_t n_offset, n_len;
   priv->checkOffset(offset, len, n_offset, n_len);
   return priv->spliceIntern(n_offset, n_len, l, xsink);
}
Exemplo n.º 8
0
void QoreValueList::push(QoreValue val) {
   assert(reference_count() == 1);
   priv->push(val);
}
Exemplo n.º 9
0
QoreValue* QoreValueList::getExistingEntryPtr(size_t num) {
   assert(reference_count() == 1);
   if (num >= priv->length)
      return 0;
   return &priv->entry[num];
}