Commit fd46f799 authored by Kirill Terekhov's avatar Kirill Terekhov
Browse files

Features

Added back() and front() functions for reference_array and
remote_reference_array classes.

Added overloaded assign() function and few more set_variable() functions
for automatic differentiation, that can be used in template functions.
parent beaa8c79
......@@ -14,15 +14,15 @@ namespace INMOST
return *this;
}
Element MakeElement(const RemoteHandleType & rh)
{
return Element(rh.first,rh.second);
}
Element MakeElement(const RemoteHandleType & rh)
{
return Element(rh.first,rh.second);
}
Element MakeElementRef(RemoteHandleType & rh)
{
return Element(rh.first,&rh.second);
}
Element MakeElementRef(RemoteHandleType & rh)
{
return Element(rh.first,&rh.second);
}
Element Storage::reference_array::operator [](size_type n)
{
......@@ -54,14 +54,30 @@ namespace INMOST
return Element(m,shell<HandleType>::const_reverse_iterator::operator *());
}
void Storage::reference_array::push_back(const Storage & ref)
{
shell<reference>::push_back(ref->GetHandle());
}
void Storage::reference_array::push_back(const Storage & ref)
{
shell<reference>::push_back(ref->GetHandle());
}
Element Storage::remote_reference_array::operator [](size_type n)
Element Storage::reference_array::back()
{
return Element(m,&shell<HandleType>::back());
}
Element Storage::reference_array::back() const
{
return Element(m,shell<HandleType>::back());
}
Element Storage::reference_array::front()
{
return Element(m,&shell<HandleType>::front());
}
Element Storage::reference_array::front() const
{
return Element(m,shell<HandleType>::front());
}
Element Storage::remote_reference_array::operator [](size_type n)
{
return MakeElementRef(shell<remote_reference>::operator[](n));
}
......@@ -70,6 +86,26 @@ namespace INMOST
return MakeElement(shell<remote_reference>::operator[](n));
}
Element Storage::remote_reference_array::back() const
{
return MakeElement(shell<remote_reference>::back());
}
Element Storage::remote_reference_array::back()
{
return MakeElementRef(shell<remote_reference>::back());
}
Element Storage::remote_reference_array::front() const
{
return MakeElement(shell<remote_reference>::front());
}
Element Storage::remote_reference_array::front()
{
return MakeElementRef(shell<remote_reference>::front());
}
Element Storage::remote_reference_array::iterator::operator->()
{
return MakeElementRef(shell<remote_reference>::iterator::operator *());
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment