Model and BaseExpression: changed the template taking a container to std::list
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1121 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -116,8 +116,8 @@ public:
|
||||
field_in_generic<FieldValue, std::vector<FieldValue>>(stream, field_name, container);
|
||||
}
|
||||
|
||||
template<typename ModelClass>
|
||||
void field_list(const wchar_t * field_name, const std::list<ModelClass> & field_value, bool insertable, bool updatable, bool is_primary_key,
|
||||
template<typename ModelContainer>
|
||||
void field_list(const wchar_t * field_name, ModelContainer & field_value, bool insertable, bool updatable, bool is_primary_key,
|
||||
ModelConnector * model_connector, int model_connector_mode)
|
||||
{
|
||||
if( out_stream && can_field_be_generated(insertable, updatable, is_primary_key) )
|
||||
@@ -251,8 +251,8 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
template<typename ModelClass>
|
||||
void put_field_value_list(const std::list<ModelClass> & field_value, ModelConnector * model_connector, int model_connector_mode)
|
||||
template<typename ModelContainer>
|
||||
void put_field_value_list(ModelContainer & field_value, ModelConnector * model_connector, int model_connector_mode)
|
||||
{
|
||||
if( out_stream )
|
||||
{
|
||||
@@ -261,7 +261,7 @@ protected:
|
||||
|
||||
bool is_first = true;
|
||||
|
||||
for(ModelClass m : field_value)
|
||||
for(auto & m : field_value)
|
||||
{
|
||||
if( out_stream )
|
||||
{
|
||||
@@ -354,73 +354,6 @@ protected:
|
||||
|
||||
|
||||
|
||||
/*
|
||||
template<typename Container>
|
||||
void field_container(const wchar_t * field_name, Container container, bool insertable = true, bool updatable = true)
|
||||
{
|
||||
typename Container::value Value; // czy tu jest Container::value? sprawdzic
|
||||
|
||||
if( !is_first_field )
|
||||
(*out_stream) << ",";
|
||||
|
||||
if( work_mode == ORM_STREAM_MODE_CREATING_JSON )
|
||||
{
|
||||
(*out_stream) << "[";
|
||||
boolean is_first = true;
|
||||
|
||||
for(Value v : container)
|
||||
{
|
||||
if( !is_first )
|
||||
(*out_stream) << ",";
|
||||
|
||||
v.map_fields(this);
|
||||
is_first = false;
|
||||
}
|
||||
|
||||
(*out_stream) << "]";
|
||||
}
|
||||
// a co z bazą danych?
|
||||
|
||||
|
||||
is_first_field = false;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
template<typename Container>
|
||||
virtual void field_container(const wchar_t * field_name, Container container, bool insertable = true, bool updatable = true)
|
||||
{
|
||||
typename Container::value Value; // czy tu jest Container::value? sprawdzic
|
||||
|
||||
if( !is_first_field )
|
||||
(*out_stream) << ",";
|
||||
|
||||
if( work_mode == ORM_STREAM_MODE_CREATING_JSON )
|
||||
{
|
||||
(*out_stream) << "[";
|
||||
boolean is_first = true;
|
||||
|
||||
for(Value v : container)
|
||||
{
|
||||
if( !is_first )
|
||||
(*out_stream) << ",";
|
||||
|
||||
v.map_fields(this);
|
||||
is_first = false;
|
||||
}
|
||||
|
||||
(*out_stream) << "]";
|
||||
}
|
||||
// a co z bazą danych?
|
||||
|
||||
|
||||
is_first_field = false;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user