Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/audemard/glucose
09 May 2023, 15:45:59 UTC
  • Code
  • Branches (9)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/glucose-reboot
    • refs/heads/main
    • refs/tags/1.0
    • refs/tags/2.0
    • refs/tags/2.1
    • refs/tags/3.0
    • refs/tags/4.0
    • refs/tags/4.1
    • refs/tags/4.2.1
    No releases to show
  • c4c4d05
  • /
  • mtl
  • /
  • VecIterator.h
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:4dbad70e3d9dfd53609adfe43c73c2014fbe1aae
origin badgedirectory badge
swh:1:dir:a574641818d30df95a482f82e2d83ec21d2a20c4
origin badgerevision badge
swh:1:rev:8cf82dc753b3ec6789bb7f926751f1b15403d091
origin badgesnapshot badge
swh:1:snp:28e547ea0ad832adcfd63a2cee0fa00955eb6e69

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
(requires biblatex-software package)
Generating citation ...
Tip revision: 8cf82dc753b3ec6789bb7f926751f1b15403d091 authored by audemard on 09 May 2023, 13:35:33 UTC
glucose reboot
Tip revision: 8cf82dc
VecIterator.h
#ifndef COSOCO_DOMAINITERATOR_H
#define COSOCO_DOMAINITERATOR_H


#include <iterator>

namespace Glucose {


template <typename T>
class VecIterator : public std::iterator<std::random_access_iterator_tag, T> {
    friend class VecIterator<const T>;

   protected:
    T * ptr_;
    int shift;

   public:
    inline VecIterator(T *ptr = nullptr, int _shift = 1) : ptr_(ptr), shift(_shift) { }


    inline VecIterator(const VecIterator &pos) : ptr_(pos.ptr_), shift(pos.shift) { }


    inline ~VecIterator() { }


   public:
    inline VecIterator &operator=(const VecIterator &other) {
        ptr_  = other.ptr_;
        shift = other.shift;
        return *this;
    }


    inline VecIterator &operator+=(int n) {
        ptr_ += (shift * n);
        return *this;
    }


    inline VecIterator &operator-=(int n) {
        ptr_ -= (shift * n);
        return *this;
    }


    inline VecIterator &operator++() {
        ptr_ += shift;
        return *this;
    }


    inline VecIterator &operator--() {
        ptr_ -= shift;
        return *this;
    }


    inline VecIterator operator+(int n) {
        VecIterator pos(*this);
        pos.ptr_ += (shift * n);
        return pos;
    }


    inline VecIterator operator-(int n) {
        VecIterator pos(*this);
        pos.ptr_ -= (shift * n);
        return pos;
    }


    inline bool operator==(const VecIterator &other) const { return (ptr_ == other.ptr_ && shift == other.shift); }


    inline bool operator!=(const VecIterator &other) const { return (ptr_ != other.ptr_ || shift != other.shift); }


    inline bool operator<(const VecIterator &other) const { return (ptr_ < other.ptr_ && shift == other.shift); }


    inline bool operator>(const VecIterator &other) const { return (ptr_ > other.ptr_ && shift == other.shift); }


    inline bool operator<=(const VecIterator &other) const { return (ptr_ <= other.ptr_ && shift == other.shift); }


    inline bool operator>=(const VecIterator &other) const { return (ptr_ >= other.ptr_ && shift == other.shift); }


    inline int operator-(const VecIterator &other) {
        assert(other.shift == shift);
        return (std::distance(other.ptr_, ptr_) / shift);
    }


    inline T &operator*() { return *ptr_; }


    inline T *operator->() { return ptr_; }


    inline T *ptr() { return ptr_; }
};
}   // namespace Glucose
#endif   // COSOCO_DOMAINITERATOR_H

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API