Merge pull request #5 from luca3m/array-count

Array methods, Table and include guards
This commit is contained in:
Emiel Bruijntjes 2014-04-02 15:48:30 +02:00
commit 400c619b01
27 changed files with 70 additions and 11 deletions

View File

@ -1,3 +1,4 @@
#pragma once
/**
* AMQP field array
*
@ -99,6 +100,25 @@ public:
*/
const Field &get(uint8_t index);
/**
* Get number of elements on this array
*
* @return array size
*/
uint32_t count() const;
/**
* Remove last element from array
*/
void pop_back();
/**
* Add field to end of array
*
* @param value
*/
void push_back(const Field &value);
/**
* Get a field
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* BooleanSet.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Class describing a (mid-level) AMQP channel implementation
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* ChannelHandler.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* ChannelImpl.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Classes.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Class describing a mid-level Amqp connection
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* ConnectionHandler.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Connection implementation
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Decimal field type for AMQP
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* EntityImpl.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Envelope.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* ExchangeType.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Available field types for AMQP
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Field proxy. Returned by the table. Can be casted to the
* relevant native type (std::string or numeric)

View File

@ -1,3 +1,4 @@
#pragma once
/**
* AmqpFlags.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* The login information to access a server
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Message.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* MetaData.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Numeric field types for AMQP
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* OutBuffer.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* ReceivedFrame.h
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* String field types for amqp
*

View File

@ -1,3 +1,4 @@
#pragma once
/**
* AMQP field table
*
@ -109,7 +110,7 @@ public:
* @param name field name
* @return the field value
*/
const Field &get(const std::string &name);
const Field &get(const std::string &name) const;
/**
* Get a field

View File

@ -1,3 +1,4 @@
#pragma once
/**
* Watchable.h
*

View File

@ -70,6 +70,21 @@ const Field &Array::get(uint8_t index)
return *_fields[index];
}
uint32_t Array::count() const
{
return _fields.size();
}
void Array::pop_back()
{
_fields.pop_back();
}
void Array::push_back(const Field& value)
{
_fields.push_back(std::shared_ptr<Field>(value.clone()));
}
/**
* Get the size this field will take when
* encoded in the AMQP wire-frame format

View File

@ -97,7 +97,7 @@ Table &Table::operator=(Table &&table)
* @param name field name
* @return the field value
*/
const Field &Table::get(const std::string &name)
const Field &Table::get(const std::string &name) const
{
// we need an empty string
static ShortString empty;