 
 import Foundation
 
+// MARK: MemCache Data Types
 
 struct CTMemCacheObjectData {
     var data: AnyObject?

        }
        
        return isExpired;
    }
    
    internal func ttlExpired(ttl:Double) -> Bool {
        return CFAbsoluteTimeGetCurrent() > ttl
    }
    
    func delete(key:String, namespace:String?="") {
        var cacheId = buildNamespacedKey(key, namespace: namespace)
        self.cache.removeValueForKey(cacheId)
    }
    
    func isEmpty() -> Bool {

    func reset() {
        self.cache.removeAll(keepCapacity: false)
    }
    
    // MARK: Private Functions
    
    // Not declared private to be visible in unit tests
    func buildNamespacedKey(key:String, namespace:String?) -> String {
        var res: String = key
        
        if (namespace != nil) && (namespace != "") {
            res = namespace!+"_"+key
        }
        
        return res
    }
    
    private func ttlExpired(ttl:Double) -> Bool {
        return CFAbsoluteTimeGetCurrent() > ttl
    }
}