Changeset 11135


Ignore:
Timestamp:
06/23/11 15:56:29 (13 years ago)
Author:
tbretz
Message:
Added two more templates for simplicifations.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DimDescriptionService.h

    r10632 r11135  
    33
    44#include <string>
     5#include <vector>
    56
    67class DimService;
     
    2223
    2324#include "dis.hxx"
    24 
     25#include <iostream>
    2526class DimDescribedService : public DimDescriptionService, public DimService
    2627{
     
    4344        // FIXME: compare number of ; with number of |
    4445    }
     46
     47    template<class T>
     48    void Update(const T &data)
     49    {
     50        //cout << "Update: " << svc.getName() << " (" << sizeof(T) << ")" << endl;
     51        setData(const_cast<T*>(&data), sizeof(T));
     52        updateService();
     53    }
     54
     55    template<typename T>
     56    void Update(const std::vector<T> &data)
     57    {
     58        std::cout << "Update: " << getName() << " " << data.size() << " " << sizeof(T) << std::endl;
     59        setData(const_cast<T*>(data.data()), data.size()*sizeof(T));
     60        updateService();
     61    }
     62
     63    // FIXME: Implement callback with boost::function instead of Pointer to this
     64
    4565};
    4666
Note: See TracChangeset for help on using the changeset viewer.